-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REF: de-duplicate precision_from_unit attempt 2 #51594
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
REF: de-duplicate precision_from_unit attempt 2 #51594
Conversation
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.
Looks good - left a comment about the error from precision_from_unit
not propagating through get_conversion_factor
, but feel free to ignore if you disagree, not a blocker
else: | ||
raise ValueError(f"cannot cast unit {unit}") | ||
m = get_conversion_factor(reso, out_reso) |
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.
if get_conversion_factor
raises, then precision_from_unit
wouldn't propagate the error - perhaps a note could be made about this in the docstring, alongside the current note?
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.
comment sounds good
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.
to keep from clogging the CI, mind if i add this comment in my next CLN: assorted branch?
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.
sounds good!
precision_from_unit is getting called in situations where it shouldn't be.