Skip to content
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

Added "mu" and "mc" prefixes. #2013

Merged
merged 5 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Pint Changelog
0.25 (unreleased)
-----------------

- Added mu and mc as alternatives for SI micro prefix
- Added ℓ as alternative for liter
- Support permille units and `‰` symbol (PR #2033, Issue #1963)

Expand Down
2 changes: 1 addition & 1 deletion pint/default_en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pico- = 1e-12 = p-
nano- = 1e-9 = n-
# The micro (U+00B5) and Greek mu (U+03BC) are both valid prefixes,
# and they often use the same glyph.
micro- = 1e-6 = µ- = μ- = u-
micro- = 1e-6 = µ- = μ- = u- = mu- = mc-
milli- = 1e-3 = m-
centi- = 1e-2 = c-
deci- = 1e-1 = d-
Expand Down
2 changes: 1 addition & 1 deletion pint/testsuite/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
femto- = 1e-15 = f-
pico- = 1e-12 = p-
nano- = 1e-9 = n-
micro- = 1e-6 = µ- = μ- = u-
micro- = 1e-6 = µ- = μ- = u- = mu- = mc-
milli- = 1e-3 = m-
centi- = 1e-2 = c-
deci- = 1e-1 = d-
Expand Down
6 changes: 6 additions & 0 deletions pint/testsuite/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,12 @@ def test_micro_creation_U03bc(self, module_registry):
def test_micro_creation_U00b5(self, module_registry):
module_registry.Quantity(2, "µm")

def test_micro_creation_mu(self, module_registry):
module_registry.Quantity(2, "mug")

def test_micro_creation_mc(self, module_registry):
module_registry.Quantity(2, "mcg")

def test_liter_creation_U2113(self, module_registry):
module_registry.Quantity(2, "ℓ")

Expand Down
Loading