diff --git a/scimath/units/electromagnetism.py b/scimath/units/electromagnetism.py index 4cc1913..318301e 100644 --- a/scimath/units/electromagnetism.py +++ b/scimath/units/electromagnetism.py @@ -57,8 +57,8 @@ ############################################################################### micro_farad = micro * farad -micro_farad.label = 'uf' -mf = micro_farad +micro_farad.label = 'µf' +µf = uf = micro_farad pico_farad = pico * farad pico_farad.label = 'pf' diff --git a/scimath/units/geo_units.py b/scimath/units/geo_units.py index f80755d..e55a04f 100644 --- a/scimath/units/geo_units.py +++ b/scimath/units/geo_units.py @@ -93,5 +93,5 @@ ############################################################################### # psonic ############################################################################### -us_per_ft = microsecond / foot -us_per_ft.label = 'us/ft' +µs_per_ft = us_per_ft = microsecond / foot +µs_per_ft.label = 'µs/ft' diff --git a/scimath/units/length.py b/scimath/units/length.py index 3ec74b0..5aed34e 100644 --- a/scimath/units/length.py +++ b/scimath/units/length.py @@ -71,7 +71,7 @@ m = meter nm = nanometer -um = micrometer +µm = um = micrometer micron = micrometer mm = millimeter cm = centimeter diff --git a/scimath/units/tests/test_units.py b/scimath/units/tests/test_units.py index 7f26cd7..c313dd6 100644 --- a/scimath/units/tests/test_units.py +++ b/scimath/units/tests/test_units.py @@ -256,12 +256,18 @@ def test_unit_parser_non_python(self): angle.grad, angle.minutes, acceleration.m_per_s2, - electromagnetism.mf, + electromagnetism.uf, volume.cm3, ] for u in odd_units: self.assertEqual(parse(u.label), u) + def test_unit_parser_micro_sign(self): + parse = lambda s: unit_parser.parse_unit(s, suppress_unknown=False) + micrometer_symbols = ["\N{MICRO SIGN}m", "\N{GREEK SMALL LETTER MU}m"] + for symbol in micrometer_symbols: + self.assertEqual(parse(symbol), length.µm) + def test_unit_parser_offsets(self): parse = lambda s: unit_parser.parse_unit(s, suppress_unknown=False) offset_units = [ diff --git a/scimath/units/time.py b/scimath/units/time.py index e53dddd..d94cd75 100644 --- a/scimath/units/time.py +++ b/scimath/units/time.py @@ -59,7 +59,7 @@ s = sec = second ps = picosecond ns = nanosecond -us = usec = microsecond +µs = µsec = us = usec = microsecond ms = msec = millisecond # plural aliases