From 382484327778e0585150449ea3ad0dc8780ce413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Mon, 17 Jun 2024 09:12:52 +0200 Subject: [PATCH 1/4] DOC: adjust doctests to changes in array repr from numpy 2.0 --- docs/usage.rst | 2 +- unyt/array.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage.rst b/docs/usage.rst index 20b28c6a..a1a7d378 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -1494,7 +1494,7 @@ Methods that hang off of a :mod:`unyt_dask_array` object and operations on One important caveat is that using Dask array functions may strip units: >>> da.sum(x_da).compute() - 49995000 + np.int64(49995000) For simple reductions, you can use the :mod:`reduce_with_units` function: diff --git a/unyt/array.py b/unyt/array.py index 19bdd3b7..2141a2c3 100644 --- a/unyt/array.py +++ b/unyt/array.py @@ -1255,7 +1255,7 @@ def argsort(self, axis=-1, kind="quicksort", order=None): >>> from unyt import km >>> data = [3, 8, 7]*km >>> print(np.argsort(data)) - [0 2 1] + [0 2 1] km >>> print(data.argsort()) [0 2 1] """ From bb7da094d024498809b7b3330cfb4a946de3a716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Fri, 21 Jun 2024 10:38:10 +0200 Subject: [PATCH 2/4] TST: exclude astropy 6.1.1 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index f4f1f181..b26583df 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ deps = pytest h5py pint - astropy + astropy!=6.1.1 coverage[toml]>=5.0 pytest-cov pytest-doctestplus From b6d331634bbaf2c26d0128f0174a1decd226a54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Fri, 21 Jun 2024 10:59:43 +0200 Subject: [PATCH 3/4] TST: exclude astropy for py39 test --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b26583df..1a4ef0d6 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ deps = pytest h5py pint - astropy!=6.1.1 + !py39: astropy!=6.1.1 coverage[toml]>=5.0 pytest-cov pytest-doctestplus From 79ed81bc49a12d1db814e32fabb8fd4dc7e53d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Fri, 21 Jun 2024 11:19:59 +0200 Subject: [PATCH 4/4] TST: skip doctests for py39 --- tox.ini | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 1a4ef0d6..4d2010d0 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,7 @@ depends = begin deps = pytest h5py - pint + !py39: pint !py39: astropy!=6.1.1 coverage[toml]>=5.0 pytest-cov @@ -32,6 +32,14 @@ commands = pytest --cov=unyt --cov-append --doctest-modules --doctest-plus --doctest-rst --basetemp={envtmpdir} coverage report --omit='.tox/*' +[testenv:py39] +# skip doctest on py39 because doctests require numpy>=2.0 and all optional deps, +# but some of our optional deps (pint, astropy) don't have a version that support +# both numpy>=2.0 and Python 3.9 +commands= + pytest --cov=unyt --cov-append --basetemp={envtmpdir} + coverage report --omit='.tox/*' + [testenv:py39-versions] deps = docutils