-
Notifications
You must be signed in to change notification settings - Fork 39
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
Refactoring. #58
Refactoring. #58
Conversation
Utility functions now live in |
Pull Request Test Coverage Report for Build 303
💛 - Coveralls |
Hi Andreas, In general, this looks very good to me. I think it's good to abstract away the classes that should not be used by the user to some extent. It's a little bit inconsistent to use CamelCase for |
Oh yeah, let's just use snake for both. Guiding the user with the case convention used in the code is a bit too arcane for my taste. |
To be more precise: |
I think there's only one error left:
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this work! Things look good, but one concern: Now that e.g. the RootFileReader isn't a top-level import anymore, access will be broken for all users.
I think we should circumvent that by adding import statements in __init__.py
or what is your opinion?
It would probably make sense to have as additional test an example analysis (e.g. one that's already on HEPData) to see if things break for users.
hepdata_lib/__init__.py
Outdated
@@ -22,6 +22,8 @@ | |||
import numpy as np |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually don't need the ROOT and numpy imports here anymore, do we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removed.
You are right about the backward compatibility. For now, I added an import to the main file as per your suggestion. Longer term, we should encourage users to switch their import statements. |
I'll work on #60 first so that we have a working docker container and binder examples again. Will get to it this week. |
If #60 is not a code issue on our side, why does this PR need to wait for it? |
* Refactoring. * Fixup import * Fixup RootFileReader TFile setter logic. * Fixup import. * Re-enable pylint warning about number of lines in module. * Fixup import * Fixup function call. * Travis: Run pylint on all hepdata_lib/*.py files. * Fix pylint errors. * Rename RootUtils -> root_utils * Remove unncecessary imports * Add RootFileReader import for backward compatibility.
First stab at #57. Any thoughts @clelange?