From aa2dfdb232c07b9f042988a9f023e233e7d1fd4f Mon Sep 17 00:00:00 2001 From: SPKorhonen Date: Wed, 12 Jun 2024 12:58:22 +0300 Subject: [PATCH 1/4] Alternatives for micro prefix Added mu and mc as alternatives for SI prefix micro. They are mostly used in chemistry and biomedical field --- pint/default_en.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pint/default_en.txt b/pint/default_en.txt index 45f241f18..378517f0a 100644 --- a/pint/default_en.txt +++ b/pint/default_en.txt @@ -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- From 7e00becd6aaa1a8ad4a9d52e30e259c80bf93633 Mon Sep 17 00:00:00 2001 From: SPKorhonen Date: Wed, 12 Jun 2024 13:03:27 +0300 Subject: [PATCH 2/4] Add micro alts to conftest --- pint/testsuite/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pint/testsuite/conftest.py b/pint/testsuite/conftest.py index 775480f0b..0a42f44af 100644 --- a/pint/testsuite/conftest.py +++ b/pint/testsuite/conftest.py @@ -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- From 3d932209d8b49c5ba42672f6deda55729627bfaf Mon Sep 17 00:00:00 2001 From: SPKorhonen Date: Wed, 12 Jun 2024 13:31:55 +0300 Subject: [PATCH 3/4] Test for mu and mc alts Added tests alternative mu and mc prefixes for micro --- pint/testsuite/test_issues.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pint/testsuite/test_issues.py b/pint/testsuite/test_issues.py index 2a0b7edf6..611adde33 100644 --- a/pint/testsuite/test_issues.py +++ b/pint/testsuite/test_issues.py @@ -403,6 +403,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") + @helpers.requires_numpy def test_issue171_real_imag(self, module_registry): qr = [1.0, 2.0, 3.0, 4.0] * module_registry.meter From f52a425d2ac910c5d868a0bfc389905ef025bee6 Mon Sep 17 00:00:00 2001 From: SPKorhonen Date: Wed, 12 Jun 2024 13:36:00 +0300 Subject: [PATCH 4/4] Update CHANGES --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e3a1b7ad0..e2ad2775a 100644 --- a/CHANGES +++ b/CHANGES @@ -4,7 +4,7 @@ Pint Changelog 0.25 (unreleased) ----------------- -Nothing added yet. +Added mu and mc as alternatives for SI micro prefix 0.24 (2024-06-07)