-
Notifications
You must be signed in to change notification settings - Fork 11
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
Issue with Units around temperature #387
Comments
To reproduce:
|
|
How is this unit test passing? https://github.com/kbase/sample_service/blob/master/test/core/validator/builtin_test.py#L178 |
Looks like the incoming units have to be absolute. Does it work with K or R? |
|
So a couple potential fixes, I think:
|
I'm leaning towards option 2 above, If we only ever use |
PR addressing this: #388 |
Another solution, with no other side effects, is to use the quantity api. pint.quantity.Quantity(1, unit).to(req_unit) which is utilized in #410 |
I've had issues with unit expressions around temperature. The error is thrown on this line
sample_service/lib/SampleService/core/validator/builtin.py
Line 222 in 695bb80
the error is:
pint.errors.OffsetUnitCalculusError: Ambiguous operation with offset unit (degree_Celsius, ). See https://pint.readthedocs.io/en/latest/nonmult.html for guidance.
The multiplication on the line shared above between
units
and1
does not work with temperatures in pint. "These temperature units are expressed in a system with a reference point, and relations between temperature units include not only a scaling factor but also an offset." in their words.The text was updated successfully, but these errors were encountered: