-
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
Add support for inhomogenous error breakdowns #265
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
==========================================
+ Coverage 90.37% 90.42% +0.04%
==========================================
Files 5 5
Lines 1112 1117 +5
Branches 251 254 +3
==========================================
+ Hits 1005 1010 +5
Misses 78 78
Partials 29 29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 for the PR! Can you please add a test in tests/test_uncertainty.py
to cover the new feature and add some explanation under Uncertainties in the documentation?
Thanks for adding the test and expanding the docs. The CI is failing due to issues with |
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 for fixing the linting for the tests. However, the CI still gives a message:
************* Module hepdata_lib
hepdata_lib/__init__.py:237:4: R0912: Too many branches (13/12) (too-many-branches)
-----------------------------------
Your code has been rated at 9.99/10
Could you please fix this too? If you don't see an easy way to refactor the make_dict
function to avoid this warning, it can be suppressed by adding a line # pylint: disable=too-many-branches
at the top of the function, but this should be avoided if possible. I think it's a current bug in the CI that the "Run pylint" still passes, so I've opened a separate PR #267 to address it.
Urgh - well, this can be circumvented by moving the additional if statement into a separate list comprehensions, e.g. like so
but that adds an extra loop for no good reason. So my preference would be to silence the linter here, but I'd leave that call to you. 🤷 |
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.
I've added # pylint: disable=too-many-branches
at the top of the make_dict
function, added NoneType
in the docstring of the sanitize_value
function, and merged the last commit to the main
branch. The workflow run for the separate "Run pylint on hepdata_lib" step now fails before adding the # pylint: disable=too-many-branches
line, as expected. I'll let @clelange perform the final review and merge.
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 for the contribution @20DM and for the review @GraemeWatt !
Proposal solution for the feature discussed in #229 :
The HepData validator already allows for cases where different bins have different error breakdowns, but
hepdata_lib
currently does not support this.With this change set one can suppress individual sources by setting them to
None
.Closes #266.
📚 Documentation preview 📚: https://hepdata-lib--265.org.readthedocs.build/en/265/