From eba6f2f2e0cefd10ef8c44952456a44cb1218749 Mon Sep 17 00:00:00 2001 From: Matthew Turk Date: Wed, 17 Jun 2020 10:38:24 -0500 Subject: [PATCH 1/4] Switch from u00b5 to u03bc for micro --- unyt/_unit_lookup_table.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/unyt/_unit_lookup_table.py b/unyt/_unit_lookup_table.py index 8970d6ad..b71c9bba 100644 --- a/unyt/_unit_lookup_table.py +++ b/unyt/_unit_lookup_table.py @@ -506,8 +506,10 @@ def append_name(n, okey, key): # Are we SI prefixable or not? if entry[4]: for prefix in unit_prefixes: - if prefix in ["u", "μ"]: - used_prefix = "µ" + # This is specifically to work around + # https://github.com/yt-project/unyt/issues/145 + if prefix in ["u", "μ", "µ"]: + used_prefix = "μ" else: used_prefix = prefix append_name(names[prefix + key], used_prefix + key, prefix + key) From 950f37a21d0082227b1406952d1948b08399a2e7 Mon Sep 17 00:00:00 2001 From: Matthew Turk Date: Wed, 17 Jun 2020 12:38:05 -0500 Subject: [PATCH 2/4] We changed the specific prefix, so update tests. --- unyt/tests/test_units.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unyt/tests/test_units.py b/unyt/tests/test_units.py index cc37ee75..e9d5ee95 100644 --- a/unyt/tests/test_units.py +++ b/unyt/tests/test_units.py @@ -769,8 +769,8 @@ def test_attosecond(): def test_micro(): from unyt import Unit - assert str(Unit("um")) == "µm" - assert str(Unit("us")) == "µs" + assert str(Unit("um")) == "μm" + assert str(Unit("us")) == "μs" def test_show_all_units_doc_table_ops(): From 8214bb2f1ae5d6971af58ac2e329778564942fc3 Mon Sep 17 00:00:00 2001 From: John ZuHone Date: Wed, 17 Jun 2020 14:19:28 -0400 Subject: [PATCH 3/4] Add docutils to the tox.ini to fix Appveyor crash --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 34aca05f..b98e44d0 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,7 @@ deps = black ; python_version >= '3.6.0' setuptools matplotlib + docutils commands = pytest --cov=unyt --cov-append --doctest-modules --doctest-plus --doctest-rst --basetemp={envtmpdir} -W once coverage report --omit='.tox/*' From cc9b165ef743fe61df1358cb4e41fe266a571e66 Mon Sep 17 00:00:00 2001 From: John ZuHone Date: Wed, 17 Jun 2020 14:27:28 -0400 Subject: [PATCH 4/4] another place where we needed to fix the prefix --- HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 1010b0d2..13731aa9 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -269,7 +269,7 @@ you run into issues please let us know by `opening an issue on GitHub >>> units.kilometer km >>> units.microsecond - µs + μs See `PR #68 `_. * The ``unyt`` codebase is now automatically formatted by `black