-
Notifications
You must be signed in to change notification settings - Fork 472
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
Fix cli uncertainty package import #2032
Fix cli uncertainty package import #2032
Conversation
… package * This changes the default behaviour for importing "uncertainties" package in cli, as it was enabled by default and was imported even if it was an optional package. * The default behaviour of the convert function has been adjusted accordingly to only consider 'uncertainties' if the argument "-U" or "--with-unc" is provided.
* The changes in the document illustrate how the `-U` flag is used to enable uncertainty in the pint-convert program. * Previously, the documentation indicated that the `-U` flag was used to disable uncertainty, but based on current changes `-U` flag would indicate `-U` is enabled. * Updates also include modifications for multiple examples demonstrating the proper `-U` flag usage.
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.
My 2 small comments
CodSpeed Performance ReportMerging #2032 will not alter performanceComparing Summary
|
* Added try/except blocks to handle ImportError and AttributeError in pint_convert.py. Now the code tries to import the 'uncertainties' library and falls back to raise an exception if the library is not present. * Similarly, an AttributeError is caught when calculating correlation of values which requires numpy, prompting users to install the package if not available.
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.
Nice job! Thanks for working on this :).
pre-commit run --all-files
with no errors