Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: adjust doctests to changes in array repr from numpy 2.0 #506

Merged
merged 4 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
12 changes: 10 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ depends = begin
deps =
pytest
h5py
pint
astropy
!py39: pint
!py39: astropy!=6.1.1
coverage[toml]>=5.0
pytest-cov
pytest-doctestplus
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion unyt/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
"""
Expand Down