Unitful.jl
                                
                                 Unitful.jl copied to clipboard
                                
                                    Unitful.jl copied to clipboard
                            
                            
                            
                        Update hour symbol to `h` and Planck constant symbol to `ℎ`
I suggest to change the default "Symbol" and "Display" from
https://github.com/PainterQubits/Unitful.jl/blob/960e09ef518b0d3ff54747460b9c3872c08df0d7/src/pkgdefaults.jl#L252
to
@unit h     "h"       Hour                  3600s         false
because this should be the usual/common default. As examples have a look at
- the IUPAC green book (section 3.7 on page 75) (sorry, the links to the newer versions like this and that don't seen to work right now) or
- BIPM resources like the Summary Brochure or the Brochure itself (in table 8 on page 145).
Of course then also the Planck constant symbol has to change. Therefore I suggest to change
https://github.com/PainterQubits/Unitful.jl/blob/960e09ef518b0d3ff54747460b9c3872c08df0d7/src/pkgdefaults.jl#L422
to
const ℎ  = 6.626_070_15e-34*J*s     # exact, Planck constant (type as "\planck<TAB>")
as it is also proposed in the above documents. The corresponding places are
- IUPAC green book (section 2.5 on page 20)
- BIPM Summary Brochure
- BIPM Brochure in table 1 on page 128
It should be quite natural in Julia to use ℎ, since this is also listed in the Julia Manual. (Search for "planck" there.)
In case this should also help to consider this breaking change: The same was done recently in Pint (the Python equivalent of Unitful) in PR https://github.com/hgrecco/pint/pull/1454. See also the corresponding issue https://github.com/hgrecco/pint/issues/719.
I'm not sure I like using ℎ for Planck's constant. I don't know what the reasoning was for including it as a codepoint in Unicode, except maybe to complement ℏ. Why should it have a dedicated symbol and not other constants such as 𝑒 (U+1D452 MATHEMATICAL ITALIC SMALL E, elementary charge), 𝑐 (U+1D450 MATHEMATICAL ITALIC SMALL C, speed of light in vacuum), 𝐺 (U+1D43A MATHEMATICAL ITALIC CAPITAL G, gravitational constant), etc.?
I can agree to using solving the conflict by assigning h to the more common hour (although that will make my particular usage of pint-convert more cumbersome), but if obscure/italic characters are going to be used for some constant, they should be used for all (at the very least ħ should be changed to ℏ too).
Since this would be breaking, it is something to consider for Unitful 2.0. That said, I’m not sure it is worth the breaking change and I worry that h and ℎ might be too easily confused.
I agree that if we change h to ℎ, we should also change ħ to ℏ. Changing all physical constants to italics would technically be the correct thing to do, but it makes them harder to type (\itc<tab> instead of just c).
There is a plan to normalize ℏ to ħ: https://github.com/JuliaLang/julia/issues/48870
If this is implemented, Unitful.ℏ and Unitful.ħ would automatically refer to the same object (we could still change the printing from "ħ" to "ℏ").
Edit: ℏ is normalized to ħ starting from Julia 1.10.