-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor isatab loader #555
Conversation
So you are basically just turning most of the code that's there into classes? I figured out what I was talking about in the meeting when I said that there were different loaders.
|
Yes. I really dislike these nested functions and these huges block of codes. I've split the logic in dedicated methods and typed variables to 1. respect separation of concerns 2. make it easier to identify what is going on in code blocks.
You are right. The class here https://github.com/ISA-tools/isa-api/blob/master/isatools/convert/isatab2json.py#L65 should be deprecated. I will discuss with @proccaserra to see what we should do here. How about raising a DeprecationWarning ?
I agree that the naming is questionable. However the way it works make sense: the object creation through the load() function may 1. Crash or 2. Not build properly but be silent about it. This is why the validation is at the dataframe level. |
That class is still being used by the function above it. I assumed it was essentially left in to be compatible with older versions. Having the new version as a parameter may be enough of an indication. A deprecation warning would make it more explicit though. Might also consider changing the "use_new_parser" default to True or change it to "use_old_parser", so that the default is not using deprecated things.
I wasn't trying to suggest any of this needed changing. I was just explaining what was brought up and why I got confused. I think the way things are is appropriate. Maybe a name change or adding to the function documentation could make things clearer, but it's not completely necessary |
@ptth222 first pass at the refactoring