JuliaPhysics / JuliaPhysics/Unitful.jl
Add consistent CGS unit system
- Dominant language
- Julia
- Stars
- 675
- Forks
- 124
- Avg merge
- 3h 38m
- Merged PRs (30d)
- 1
Description
First of all, I would like to thank the creators of the package. It is very powerful: one can add all sorts of units by expressing them in terms of SI units. This way, some CGS units were already added in issue #395.
However, I should point out that varying units is not the only difference between the two unit systems. They also differ in how the base dimensions and derived dimensions are defined. (Of course, it is true only for electromagnetic quantities.) So, if one plugs CGS units into CGS equations, but CGS units are expressed in terms of SI units, the dimension of the answer is nonsensical.
So, in order to work with CGS units consistently, one needs to correctly define base and derived dimensions. The good news is, as far as I understand, one does not need to rewrite everything to incorporate such changes; one only needs to rewrite the file [pkgdefaults.jl](https://github.com/PainterQubits/Unitful.jl/blob/master/src/pkgdefaults.jl).
Since the form of equations involving electromagnetic quantities are different in SI and CGS systems, one never mixes both types of units in the calculation: the quantities are first converted to a single preferred system, and only then are plugged into equations.
The conversion part should be easily handled by the units definitions (we can define CGS units in terms of SI units, but we can also do the reverse thing). Because of this, there is, actually, no point to bother too much about the transformations of quantities between the two unit systems. A user would choose the unit system when the package is loaded, and then he/she would stick with it.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.