Closed TorkelE closed 3 months ago
Can we call it 1 Molar instead of 1 M? Otherwise I worry about ambiguity with M for Mega (SI prefix).
But apart from that I'm happy to review a PR on this.
Don't think I've actually seen it written "Molar", not a full-blooded chemist/biologists though (but I could ask one how weird it would be). "Molar" is better than not having it at all though.
What do other units packages do here? If there’s precedent it’s easier to decide on. e.g., what do Unitful, Pint, AstroPy do?
Also note there is @register_unit
in the meantime.
If I interpret it correct, it is defined as M
in both Unitful and Pint:
Unitful (https://github.com/PainterQubits/Unitful.jl/blob/fbf71a66d475423c65bd6e981794e9298ded79da/src/pkgdefaults.jl#L179, line 350)
Pint (https://github.com/hgrecco/pint/blob/master/pint/default_en.txt, line 353
AstroPy has it defined as mol
, I think (https://github.com/astropy/astropy/blob/878cc772cd648300367930707f7f6a1f1e5e4172/astropy/units/physical.py#L45, line 45), while seems bad since it is easily confused with mole.
We also use it in Catalyst's current tests for units (which depends on Unitful, but which we want to move to DynamicQuantities): https://github.com/SciML/Catalyst.jl/blob/master/test/miscellaneous_tests/units.jl
Thanks! Okay since Unitful and Pint both do M
, and since you have a use case, that seems like a good enough reason to do it here as well. So happy to take a PR for this.
Thanks, I will try to get to it this coming week
Closed with #128
Molar (different from moles) are commonly used in chemistry and biology. It would be useful to support it:
(Molarity is defined as moles per litre, e.g.
M = mol/L
)