JuliaPhysics / JuliaPhysics/Unitful.jl

Update hour symbol to `h` and Planck constant symbol to `ℎ`

Open
#536 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
675
Forks
124
Avg merge
3h 38m
Merged PRs (30d)
1

Description

I suggest to change the default "Symbol" and "Display" from

https://github.com/PainterQubits/Unitful.jl/blob/960e09ef518b0d3ff54747460b9c3872c08df0d7/src/pkgdefaults.jl#L252

to

```julia
@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)](http://old.iupac.org/publications/books/gbook/green_book_2ed.pdf#page=82) (sorry, the links to the newer versions like [this](https://iupac.org/what-we-do/books/greenbook/) and [that](https://iupac.org/iupac-green-book-v5/) don't seen to work right now) or
- BIPM resources like the [Summary Brochure](https://www.bipm.org/documents/20126/41483022/SI-Brochure-9-concise-EN.pdf/2fda4656-e236-0fcb-3867-36ca74eea4e3#page=4) or the [Brochure itself (in table 8 on page 145)](https://www.bipm.org/documents/20126/41483022/SI-Brochure-9-EN.pdf#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

```julia
const ℎ = 6.626_070_15e-34*J*s # exact, Planck constant (type as "\planck")
```

as it is also proposed in the above documents. The corresponding places are
- [IUPAC green book (section 2.5 on page 20)](http://old.iupac.org/publications/books/gbook/green_book_2ed.pdf#page=28)
- BIPM [Summary Brochure](https://www.bipm.org/documents/20126/41483022/SI-Brochure-9-concise-EN.pdf/2fda4656-e236-0fcb-3867-36ca74eea4e3#page=1)
- BIPM [Brochure in table 1 on page 128](https://www.bipm.org/documents/20126/41483022/SI-Brochure-9-EN.pdf#page=128)

It should be quite natural in Julia to use `ℎ`, since this is also listed in the [Julia Manual](https://docs.julialang.org/en/v1/manual/unicode-input/). (Search for "planck" there.)

In case this should also help to consider this breaking change: The same was done recently in [`Pint`](https://github.com/hgrecco/pint) (the Python equivalent of `Unitful`) in PR . See also the corresponding issue .

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/pkgdefaults.jl at the referenced locations around lines 252 and 422, and inspect how the hour and Planck constant symbols are defined. Done means the default hour symbol is h, the Planck constant symbol is ℎ, and the surrounding definitions remain consistent with the requested Julia syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.