From 9b78bb43b7107b19e163f9d059c6649efbf103f4 Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Wed, 9 Sep 2020 07:44:50 -0500 Subject: [PATCH 01/15] Fix unyt_array.to() to support complex-valued arrays --- unyt/array.py | 17 +++++------------ unyt/tests/test_unyt_array.py | 12 ++++++++++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/unyt/array.py b/unyt/array.py index 281d31be..dc46e152 100644 --- a/unyt/array.py +++ b/unyt/array.py @@ -845,19 +845,12 @@ def in_units(self, units, equivalence=None, **kwargs): ) new_dtype = np.dtype("f" + str(dsize)) conversion_factor = new_dtype.type(conversion_factor) - ret = np.asarray(self.ndview * conversion_factor, dtype=new_dtype) + ret = self.v * conversion_factor if offset: - np.subtract(ret, offset, ret) - - try: - new_array = type(self)( - ret, new_units, bypass_validation=True, name=self.name - ) - except TypeError: - # subclasses might not take name as a kwarg - new_array = type(self)(ret, new_units, bypass_validation=True) - - return new_array + ret = ret - offset + ret = type(self)(ret, new_units) + ret.name = self.name + return ret else: return self.to_equivalent(units, equivalence, **kwargs) diff --git a/unyt/tests/test_unyt_array.py b/unyt/tests/test_unyt_array.py index 4f69fb72..ddc1451b 100644 --- a/unyt/tests/test_unyt_array.py +++ b/unyt/tests/test_unyt_array.py @@ -2245,11 +2245,11 @@ def integer_semantics(inp): assert arr.dtype.name == "int32" answer = (inp * km).astype("int32").to("mile") assert_array_equal(ret, answer) - assert ret.dtype.name == "float32" + assert ret.dtype.name == "float64" ret = arr.in_units("m") assert arr.dtype != ret.dtype - assert ret.dtype.name == "float32" + assert ret.dtype.name == "float64" arr.convert_to_units("m") assert arr.dtype.name == "float32" @@ -2423,3 +2423,11 @@ def test_kip(): def test_ksi(): assert_allclose_units(unyt_quantity(1, "lbf/inch**2"), unyt_quantity(0.001, "ksi")) + + +def test_complexvalued(): + freq = unyt_array([1j, 1j * 10], "Hz") + arr = 1 / (Unit("F") * Unit("Ω") * freq) + arr = arr.to("dimensionless") + assert arr.units.is_dimensionless + assert np.all(arr.v == np.asarray([-1j, -1j * 0.1])) From 252316ef0cce9f3934fddacb615085fa60e3127b Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Wed, 9 Sep 2020 08:53:49 -0500 Subject: [PATCH 02/15] Fix unyt_array.to() to support complex-valued arrays --- unyt/array.py | 6 +++--- unyt/tests/test_unyt_array.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/unyt/array.py b/unyt/array.py index dc46e152..0f96a859 100644 --- a/unyt/array.py +++ b/unyt/array.py @@ -843,9 +843,9 @@ def in_units(self, units, equivalence=None, **kwargs): RuntimeWarning, stacklevel=2, ) - new_dtype = np.dtype("f" + str(dsize)) - conversion_factor = new_dtype.type(conversion_factor) - ret = self.v * conversion_factor + new_dtypekind = "c" if self.dtype.kind == "c" else "f" + new_dtype = np.dtype(new_dtypekind + str(dsize)) + ret = np.asarray(self.v * conversion_factor, dtype=new_dtype) if offset: ret = ret - offset ret = type(self)(ret, new_units) diff --git a/unyt/tests/test_unyt_array.py b/unyt/tests/test_unyt_array.py index ddc1451b..66a22f65 100644 --- a/unyt/tests/test_unyt_array.py +++ b/unyt/tests/test_unyt_array.py @@ -2245,11 +2245,11 @@ def integer_semantics(inp): assert arr.dtype.name == "int32" answer = (inp * km).astype("int32").to("mile") assert_array_equal(ret, answer) - assert ret.dtype.name == "float64" + assert ret.dtype.name == "float32" ret = arr.in_units("m") assert arr.dtype != ret.dtype - assert ret.dtype.name == "float64" + assert ret.dtype.name == "float32" arr.convert_to_units("m") assert arr.dtype.name == "float32" From fbd04ee96257e2758622c5c9926e98e79b0468c5 Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Wed, 9 Sep 2020 09:10:06 -0500 Subject: [PATCH 03/15] New black formatting --- unyt/mpl_interface.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unyt/mpl_interface.py b/unyt/mpl_interface.py index 5c8a685c..4c76c85c 100644 --- a/unyt/mpl_interface.py +++ b/unyt/mpl_interface.py @@ -178,11 +178,11 @@ def __call__(self): @property def label_style(self): """str: One of the following set, ``{'()', '[]', '/'}``. - These choices correspond to the following unit labels: + These choices correspond to the following unit labels: - * ``'()'`` -> ``'(unit)'`` - * ``'[]'`` -> ``'[unit]'`` - * ``'/'`` -> ``'q_x / unit'`` + * ``'()'`` -> ``'(unit)'`` + * ``'[]'`` -> ``'[unit]'`` + * ``'/'`` -> ``'q_x / unit'`` """ return self._labelstyle From fb3dea3baad23f15d9aaac1f740b4e6b86afc834 Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Wed, 9 Sep 2020 13:15:37 -0500 Subject: [PATCH 04/15] Add more tests of complex-valued arrays --- unyt/array.py | 3 ++- unyt/tests/test_unyt_array.py | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/unyt/array.py b/unyt/array.py index 0f96a859..c448b15e 100644 --- a/unyt/array.py +++ b/unyt/array.py @@ -2328,7 +2328,8 @@ def loadtxt(fname, dtype="float", delimiter="\t", usecols=None, comments="#"): # Here we catch the first line of numbers col_words = line.strip().split(delimiter) for word in col_words: - float(word) + # test that word can be converted to a number + complex(word) num_cols = len(col_words) break f.close() diff --git a/unyt/tests/test_unyt_array.py b/unyt/tests/test_unyt_array.py index 66a22f65..73cd0e02 100644 --- a/unyt/tests/test_unyt_array.py +++ b/unyt/tests/test_unyt_array.py @@ -2431,3 +2431,30 @@ def test_complexvalued(): arr = arr.to("dimensionless") assert arr.units.is_dimensionless assert np.all(arr.v == np.asarray([-1j, -1j * 0.1])) + arr = unyt_array([1j, 1j * 10], "mJ") + arr.convert_to_base() + assert_allclose_units(arr, unyt_array([1j * 0.001, 1j * 0.01], "J")) + arr.convert_to_units("mJ") + assert_allclose_units(arr, unyt_array([1j, 1j * 10], "mJ")) + arr.convert_to_mks() + assert_allclose_units(arr, unyt_array([1j * 0.001, 1j * 0.01], "J")) + arr.convert_to_cgs() + assert_allclose_units(arr, unyt_array([1j * 10000, 1j * 100000], "erg")) + arr.convert_to_equivalent("K", "thermal") + assert_allclose_units( + arr, unyt_array([1j * 7.24297157e19, 1j * 7.24297157e20], "K") + ) + arr = arr.to_equivalent("J", "thermal") + assert_allclose_units(arr, unyt_array([1j * 0.001, 1j * 0.01], "J")) + assert_allclose_units(arr.to_ndarray(), np.asarray([1j * 0.001, 1j * 0.01])) + assert_allclose_units(arr.to_value(), np.asarray([1j * 0.001, 1j * 0.01])) + assert arr.tolist() == [1j * 0.001, 1j * 0.01] + assert_allclose_units(arr.in_units("mJ"), unyt_array([1j, 1j * 10], "mJ")) + assert_allclose_units(arr.in_base(), unyt_array([1j * 0.001, 1j * 0.01], "J")) + assert_allclose_units(arr.in_cgs(), unyt_array([1j * 10000, 1j * 100000], "erg")) + assert_allclose_units(arr.in_mks(), unyt_array([1j * 0.001, 1j * 0.01], "J")) + file = tempfile.NamedTemporaryFile("wt", delete=False) + savetxt(file, arr) + file.close() + farr = loadtxt(file.name, dtype=np.complex128) + assert_allclose_units(farr, unyt_array([1j * 0.001, 1j * 0.01], "J")) From b7d46b846f2d99e4d887bf91b80921f65fe17960 Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Wed, 9 Sep 2020 13:41:54 -0500 Subject: [PATCH 05/15] Add more tests of complex-valued arrays --- unyt/array.py | 2 -- unyt/tests/test_unyt_array.py | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/unyt/array.py b/unyt/array.py index c448b15e..02ecbf10 100644 --- a/unyt/array.py +++ b/unyt/array.py @@ -975,8 +975,6 @@ def in_base(self, unit_system=None): else: to_units = self.units.get_base_equivalent(unit_system) conv, offset = self.units.get_conversion_factor(to_units, self.dtype) - new_dtype = np.dtype("f" + str(self.dtype.itemsize)) - conv = new_dtype.type(conv) ret = self.v * conv if offset: ret = ret - offset diff --git a/unyt/tests/test_unyt_array.py b/unyt/tests/test_unyt_array.py index 73cd0e02..d5898eec 100644 --- a/unyt/tests/test_unyt_array.py +++ b/unyt/tests/test_unyt_array.py @@ -2453,8 +2453,7 @@ def test_complexvalued(): assert_allclose_units(arr.in_base(), unyt_array([1j * 0.001, 1j * 0.01], "J")) assert_allclose_units(arr.in_cgs(), unyt_array([1j * 10000, 1j * 100000], "erg")) assert_allclose_units(arr.in_mks(), unyt_array([1j * 0.001, 1j * 0.01], "J")) - file = tempfile.NamedTemporaryFile("wt", delete=False) + file = "test_complexvalued.txt" savetxt(file, arr) - file.close() - farr = loadtxt(file.name, dtype=np.complex128) + farr = loadtxt(file, dtype=np.complex128) assert_allclose_units(farr, unyt_array([1j * 0.001, 1j * 0.01], "J")) From 7e7a29916c20bb9d4aae316edeb057259242aded Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 5 Oct 2020 13:13:32 -0600 Subject: [PATCH 06/15] fix for newest black --- unyt/mpl_interface.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unyt/mpl_interface.py b/unyt/mpl_interface.py index 5c8a685c..4c76c85c 100644 --- a/unyt/mpl_interface.py +++ b/unyt/mpl_interface.py @@ -178,11 +178,11 @@ def __call__(self): @property def label_style(self): """str: One of the following set, ``{'()', '[]', '/'}``. - These choices correspond to the following unit labels: + These choices correspond to the following unit labels: - * ``'()'`` -> ``'(unit)'`` - * ``'[]'`` -> ``'[unit]'`` - * ``'/'`` -> ``'q_x / unit'`` + * ``'()'`` -> ``'(unit)'`` + * ``'[]'`` -> ``'[unit]'`` + * ``'/'`` -> ``'q_x / unit'`` """ return self._labelstyle From 85f8132addfe778da2b0817d993741ec00c39196 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 5 Oct 2020 13:37:20 -0600 Subject: [PATCH 07/15] drop python3.5 tests --- tox.ini | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index b98e44d0..3d66fea4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,11 @@ [tox] -envlist = py36-docs,begin,py35-dependencies,py35-versions,py{35,36,37,38},py38-unyt-module-test-function,end +envlist = py36-docs,begin,py36-dependencies,py36-versions,py{36,37,38},py38-unyt-module-test-function,end [travis] python = 3.8: py38, py38-unyt-module-test-function 3.7: py37 3.6: py36, py36-docs - 3.5: py35, py35-dependencies, py35-versions [testenv] setenv = @@ -33,8 +32,9 @@ commands = pytest --cov=unyt --cov-append --doctest-modules --doctest-plus --doctest-rst --basetemp={envtmpdir} -W once coverage report --omit='.tox/*' -[testenv:py35-versions] +[testenv:py36-versions] deps = + docutils pytest sympy==1.2 numpy==1.13.3 @@ -50,8 +50,9 @@ commands = pytest --cov=unyt --cov-append --basetemp={envtmpdir} -W once coverage report --omit='.tox/*' -[testenv:py35-dependencies] +[testenv:py36-dependencies] deps = + docutils pytest sympy numpy From 13ce2a04df38df6d7fef128117912cc61a6f4ea4 Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Mon, 5 Oct 2020 14:38:10 -0500 Subject: [PATCH 08/15] Update changelog --- HISTORY.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index b1b54546..9fb88f62 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,24 @@ History ======= +2.7.3 (2020-10-05) +------------------ + +* Add ``delta_degC`` and ``delta_degF`` units to support temperature difference + arithmetic. See `PR #152 `_. Thank you + to Lee Johnston (@l-johnston on GitHub) for the contribution. +* Fix an issue where a subsequent load of the unit registry with units that are + equal but not identical leads to a crash. See `PR #158 + `_. Thank you to Matthew Turk + (@matthewturk on GitHub) for the initial bug report and fix. +* Add force unit ``kip`` and pressure unit ``psi``. Thank you to P. Talley + (@otaithleigh on GitHub) for the contribution. +* Fix an issue where arithmetic operations on units defined in different registries + and having the conversion defined in one direction would lead to a crash. + See `PR #164 `_. Thank you to + Clément Robert (@neutrinoceros on GitHub) for the initial bug report and fix. + + 2.7.2 (2020-06-29) ------------------ From b7764fdbada690b38e7031e8c996bcfa6d22c143 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 5 Oct 2020 13:43:47 -0600 Subject: [PATCH 09/15] remove nonfunctional line from setup.cfg pytest complains about --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 9f3c988b..67df2518 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,6 @@ universal = 1 test = pytest [tool:pytest] -collect_ignore = ['setup.py'] norecursedirs = benchmarks paper .* [versioneer] From b59b1813f8690b002e9f80690e6251401db6ef46 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 5 Oct 2020 13:46:23 -0600 Subject: [PATCH 10/15] tweaks for changelog, call next version 2.8.0 --- HISTORY.rst | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 9fb88f62..07cadaa3 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,22 +2,26 @@ History ======= -2.7.3 (2020-10-05) +2.8.0 (2020-10-05) ------------------ +* Dropped support for Python 3.5. * Add ``delta_degC`` and ``delta_degF`` units to support temperature difference - arithmetic. See `PR #152 `_. Thank you - to Lee Johnston (@l-johnston on GitHub) for the contribution. + arithmetic. See `PR #152 + `_. Thank you to Lee Johnston + (@l-johnston on GitHub) for the contribution. * Fix an issue where a subsequent load of the unit registry with units that are equal but not identical leads to a crash. See `PR #158 `_. Thank you to Matthew Turk (@matthewturk on GitHub) for the initial bug report and fix. * Add force unit ``kip`` and pressure unit ``psi``. Thank you to P. Talley - (@otaithleigh on GitHub) for the contribution. -* Fix an issue where arithmetic operations on units defined in different registries - and having the conversion defined in one direction would lead to a crash. - See `PR #164 `_. Thank you to - Clément Robert (@neutrinoceros on GitHub) for the initial bug report and fix. + (@otaithleigh on GitHub) for the contribution. See `PR #162 + `_. +* Fix an issue where arithmetic operations on units defined in different + registries and having the conversion defined in one direction would lead to a + crash. See `PR #164 `_. Thank + you to Clément Robert (@neutrinoceros on GitHub) for the initial bug report + and fix. 2.7.2 (2020-06-29) From 819d898d987afbbc60405723329599e9b099192b Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Fri, 9 Oct 2020 06:32:39 -0500 Subject: [PATCH 11/15] Fix SI prefix scaling of degree Celsius --- unyt/tests/test_units.py | 10 ++++++++++ unyt/unit_object.py | 18 ++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/unyt/tests/test_units.py b/unyt/tests/test_units.py index cc509fd6..66a16a44 100644 --- a/unyt/tests/test_units.py +++ b/unyt/tests/test_units.py @@ -858,6 +858,16 @@ def test_degC(): assert str(a) == "1 °C" +def test_degC_with_SIprefixes(): + assert_allclose_units(1 * Unit("mdegC"), 0.001 * Unit("degC")) + assert_allclose_units(1 * Unit("degC"), 1000 * Unit("mdegC")) + assert_allclose_units(73 * Unit("degF"), 22777.779 * Unit("mdegC")) + assert_allclose_units(22777.779 * Unit("mdegC"), 73 * Unit("degF")) + assert_allclose_units(22777.779 * Unit("mdegC"), 532.67 * Unit("R")) + assert_allclose_units(1 * Unit("mK"), -273149.0 * Unit("mdegC")) + assert_allclose_units(1 * Unit("mdegC"), 273151.0 * Unit("mK")) + + def test_delta_degC(): a = 1 * Unit("delta_degC") assert str(a) == "1 Δ°C" diff --git a/unyt/unit_object.py b/unyt/unit_object.py index 54f74edb..faceebdd 100644 --- a/unyt/unit_object.py +++ b/unyt/unit_object.py @@ -940,8 +940,22 @@ def _get_conversion_factor(old_units, new_units, dtype): if old_units.base_offset == 0 and new_units.base_offset == 0: return (ratio, None) else: - # the dimensions are the same, so both are temperatures, where - # it's legal to convert units so no need to do error checking + # dimensions can be either temperature or angle (lat, lon) + if old_units.dimensions == temperature: + # for degree Celsius, back out the SI prefix scaling from + # offset scaling for degree Fahrenheit + oldr = repr(old_units) + newr = repr(new_units) + old_offset = old_units.base_offset + new_offset = new_units.base_offset + offset_scaler = 1.0 + if oldr == "degF": + old_offset *= old_units.base_value + if newr in ["degF", "R"]: + old_offset /= new_units.base_value + if newr.endswith("degC") or newr.endswith("K"): + offset_scaler /= new_units.base_value + return ratio, offset_scaler * (old_offset - new_offset) return ratio, ratio * old_units.base_offset - new_units.base_offset From 24fcdf4d3ca078c7816dc6963c84ee210d612e87 Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Fri, 9 Oct 2020 07:06:19 -0500 Subject: [PATCH 12/15] Update docstring degree Celsius conversion factor --- unyt/unit_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unyt/unit_object.py b/unyt/unit_object.py index faceebdd..fbd0877f 100644 --- a/unyt/unit_object.py +++ b/unyt/unit_object.py @@ -686,7 +686,7 @@ def get_conversion_factor(self, other_units, dtype=None): >>> km.get_conversion_factor(cm) (100000.0, None) >>> degree_celsius.get_conversion_factor(degree_fahrenheit) - (1.7999999999999998, -31.999999999999886) + (1.7999999999999998, -31.999999999999943) """ return _get_conversion_factor(self, other_units, dtype) From b9beeb6521d9dcc83c1e5d47a03653daaf24288b Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Sat, 10 Oct 2020 08:27:30 -0500 Subject: [PATCH 13/15] Address review comments --- unyt/array.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/unyt/array.py b/unyt/array.py index 02ecbf10..012ccaf0 100644 --- a/unyt/array.py +++ b/unyt/array.py @@ -845,12 +845,19 @@ def in_units(self, units, equivalence=None, **kwargs): ) new_dtypekind = "c" if self.dtype.kind == "c" else "f" new_dtype = np.dtype(new_dtypekind + str(dsize)) - ret = np.asarray(self.v * conversion_factor, dtype=new_dtype) + ret = np.asarray(self.ndview * conversion_factor, dtype=new_dtype) if offset: - ret = ret - offset - ret = type(self)(ret, new_units) - ret.name = self.name - return ret + np.subtract(ret, offset, ret) + + try: + new_array = type(self)( + ret, new_units, bypass_validation=True, name=self.name + ) + except TypeError: + # subclasses might not take name as a kwarg + new_array = type(self)(ret, new_units, bypass_validation=True) + + return new_array else: return self.to_equivalent(units, equivalence, **kwargs) From efd73c3802a6d118d7904c8900567739e1d3a1e6 Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Sat, 10 Oct 2020 09:24:09 -0500 Subject: [PATCH 14/15] Fix SI prefix scaling of degree Celsius using _split_prefix strategy --- unyt/unit_object.py | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/unyt/unit_object.py b/unyt/unit_object.py index fbd0877f..19204caf 100644 --- a/unyt/unit_object.py +++ b/unyt/unit_object.py @@ -936,27 +936,25 @@ def _get_conversion_factor(old_units, new_units, dtype): raise UnitConversionError( old_units, old_units.dimensions, new_units, new_units.dimensions ) - ratio = old_units.base_value / new_units.base_value - if old_units.base_offset == 0 and new_units.base_offset == 0: + old_basevalue = old_units.base_value + old_baseoffset = old_units.base_offset + new_basevalue = new_units.base_value + new_baseoffset = new_units.base_offset + ratio = old_basevalue / new_basevalue + if old_baseoffset == 0 and new_baseoffset == 0: return (ratio, None) else: - # dimensions can be either temperature or angle (lat, lon) + # the dimensions are either temperature or angle (lat, lon) if old_units.dimensions == temperature: # for degree Celsius, back out the SI prefix scaling from # offset scaling for degree Fahrenheit - oldr = repr(old_units) - newr = repr(new_units) - old_offset = old_units.base_offset - new_offset = new_units.base_offset - offset_scaler = 1.0 - if oldr == "degF": - old_offset *= old_units.base_value - if newr in ["degF", "R"]: - old_offset /= new_units.base_value - if newr.endswith("degC") or newr.endswith("K"): - offset_scaler /= new_units.base_value - return ratio, offset_scaler * (old_offset - new_offset) - return ratio, ratio * old_units.base_offset - new_units.base_offset + old_prefix, _ = _split_prefix(str(old_units), old_units.registry.lut) + if old_prefix != "": + old_baseoffset /= old_basevalue + new_prefix, _ = _split_prefix(str(new_units), new_units.registry.lut) + if new_prefix != "": + new_baseoffset /= new_basevalue + return ratio, ratio * old_baseoffset - new_baseoffset # From 1cafc9211fa608bc6b105e8e99f324cb97b17324 Mon Sep 17 00:00:00 2001 From: Lee Johnston Date: Sat, 10 Oct 2020 09:32:22 -0500 Subject: [PATCH 15/15] Revert docstring --- unyt/unit_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unyt/unit_object.py b/unyt/unit_object.py index 19204caf..be2546f4 100644 --- a/unyt/unit_object.py +++ b/unyt/unit_object.py @@ -686,7 +686,7 @@ def get_conversion_factor(self, other_units, dtype=None): >>> km.get_conversion_factor(cm) (100000.0, None) >>> degree_celsius.get_conversion_factor(degree_fahrenheit) - (1.7999999999999998, -31.999999999999943) + (1.7999999999999998, -31.999999999999886) """ return _get_conversion_factor(self, other_units, dtype)