-
Notifications
You must be signed in to change notification settings - Fork 473
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
"h" should be the abbreviation of hours #719
Comments
Changing this now could break backwards compatibility. An alternate solution would be to define a different registry that is according to the CGPM standard, which would define Planck as something other than |
I think we should put constants into a namespace in the long run. But now I agree with @jondoesntgit here. |
How would namespaces mesh with Quanity? Say that I wrote a quantity:
|
Not sure I get this. I think it's much more likely for a new user to expect h for hours rather than Planck. |
By the way I vote for having constants in another registry. They may work the same, but they are a different thing in concept. |
If we ignore the backwards-compatibility issues, I think that the actual intuitive behaviour is to read Also, I think that separating constants from units is a good idea. IMHO constants should be Quantities, not units. |
Agreed that it seems uninutivite to define quantities based on units (1.72 Planck constants). I would, however, like to avoid a situation where Pint tacitly interprets u.h as Planck constant and Q_(1, ‘h’) as hour. The symbol should remain constant. I think Scipy’s units package puts all its constants in a namespace. |
Agreed, preferably this or at least separate namespaces for constants would help here. I was also just tripped up by the unintuitive parsing of "1h". |
Is there any simple work-around to create a custom unit registry in which |
Grepping for That happened in commit ae189a1 where |
IMO we should make a breaking change for this case, since it is really disturbing for new users & can potentially introduce bugs when using pint. I like the idea of a dedicated namespace, but it's difficult to implement since we rely only on strings in the file definition. Following BIPM standard & ISO/IEC 80000 series Quantities and units & IUPAC Green Book, roman font is used for units & italic symbols for quantities to avoid any ambiguity. |
At least for the hour vs planck constant case, we can use unicode for planck constant. |
@akaihola Not sure if you'd qualify this as "simple", but here's a hacky workaround:
Check:
|
@jules-ch What do you think of this approach for constants? |
"hr" is used as an abbreviation for hours, but this is not according to standard (see https://www.bipm.org/en/CGPM/db/9/7/), and much less common than "h" worldwide.
Here "h" is used for the Planck constant, which I think has much less use than the hours symbol. Both "h" and "hr" should be used for hours, to avoid misunderstanding. Planck should be called something else.
The text was updated successfully, but these errors were encountered: