Closed mtb-za closed 2 years ago
@kwinkunks How do you feel about names
being a mandatory argument (even if the default is just True
)? If we do not have that, then we need to explicitly ask for which column is which (for important columns like top
), and then we can only make a generic name for the ones that we do not actually ask for, which is not very helpful.
Having either names=True
, or names=['top', 'base', 'description']
would sidestep the above potential headache. names=True
will take the first row (after any skip_header
) as the column names, while the other passes them in explicitly. Making it mandatory should make the code cleaner and easier to understand.
As it is, the code is using top
and base
if names == None
, but these are not being passed, because I took them out in a commit earlier. I can put them back if we decide not to go this route easily enough.
Damn, I can't remember where we left this after the hackathon. Looking at it again, but ping me @mtb-za if you have anything to add!
I recall it being ready, with no major changes to the user side, but will take another, proper look.
Yeah, it definitely will need additional tests, or changes to existing ones.
Bottom line: it's not working, and it's going to take quite some refactoring. Knee-deep in it now.
I think I am going to have to back it out --- I can't get it to work. It needs looking at again.
The first of a few projected PRs on this branch. Others should look at things like
from_dict
,from_json
and so on.This one makes changes to
from_csv
to usenp.genfromtxt
in the background. This allows for more flexibility, and a more robust set of customisation when reading in data.We might still want to add some new args, for things like
top
,base
columns. In theory, the use of thenames
arg should fix this.There are a fair few that will be deprecated, going forwards.
This will address #128, and part of #46