-
Notifications
You must be signed in to change notification settings - Fork 50
Real Quantity with Units Module #1024
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
Conversation
Pinging here @RobPasMue. He's feedback may be useful for this, as he implemented a units module on top of pint for an internal project. |
Thank you, @jorgepiloto |
>>> q
Quantity (5.0, "m")
>>> -q # should return Quantity(-5.0, "m")
-5.0
>>> |
|
What is the float or si_value of |
@h-krishnan @seanpearsonuk @dnwillia-work @mkundu1
The degree Celsius is itself used in SI units alongside the Kelvin - https://en.wikipedia.org/wiki/Celsius "The degree Celsius is the unit of [temperature] on the Celsius scale, one of 2 [temperature scales] used in the [International System of Units] alongside the [Kelvin scale]" (mentioned on Wikipedia)
One Celsius degree is an interval of 1 K, and zero degrees Celsius is 273.15 K. Above point is mentioned on official website of US government - Hence there are 2 parts now. 1st part - representation of Celsius in terms of Kelvin (includes SI multiplier as 1) This gives float or si_value and si_unit of 2nd part - conversion of Celsius to Kelvin (includes addition of an offset 273.15) This gives conversion It is also defined in Therefore we have also defined this mapping at 2 places in 1st is in 2nd is in
We are also consistent with all conversions mentioned on following website - We have covered and verified conversions from above website, Thank you. |
@jorgepiloto @h-krishnan @seanpearsonuk @dnwillia-work @mkundu1 We have found 1 bug in It does not convert temperatures properly. See following case - Converting
and this current Thank you. |
-40K makes sense only as a temperature difference so the conversion to relative scales should be considered undefined. While pint seems to be inconsistent between C and microC, neither result is worse than the other. |
My opinion: |
@h-krishnan @seanpearsonuk @dnwillia-work @mkundu1 The main point related to this is, the
Current
If we try to construct it as So we summarize above in following points -
The conclusion is as follows - The Thank you. |
@hpohekar @seanpearsonuk @dnwillia-work So, what does |
I think this test confirms that it works as you suggest: We could add some additional properties to the quantity object to make it clear what it is. Another one is intensive or extensive, and, if it's the former is it per unit area or pure unit volume. |
@h-krishnan @dnwillia-work @seanpearsonuk Right, in absence of any other context, currently we can not differentiate between whether the We will have to handle this case differently. Thank you. |
Developed Real Quantity with Units Module.
Checked all test cases from C++ side units library and working fine.