Skip to content

Commit 675f362

Browse files
crusaderkymathause
andauthored
Remove ad-hoc handling of NEP18 libraries in CI (#5740)
* CI versions refresh * docs * Update xarray/tests/test_ufuncs.py Co-authored-by: Mathias Hauser <[email protected]> * Update xarray/ufuncs.py Co-authored-by: Mathias Hauser <[email protected]> Co-authored-by: Mathias Hauser <[email protected]>
1 parent 8c9c0f6 commit 675f362

File tree

8 files changed

+19
-54
lines changed

8 files changed

+19
-54
lines changed

.github/workflows/ci-additional.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
[
4343
"py37-bare-minimum",
4444
"py37-min-all-deps",
45-
"py37-min-nep18",
4645
"py38-all-but-dask",
4746
"py38-flaky",
4847
]

ci/requirements/py37-min-all-deps.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ dependencies:
2525
- lxml=4.5 # Optional dep of pydap
2626
- matplotlib-base=3.2
2727
- nc-time-axis=1.2
28-
# netcdf follows a 1.major.minor[.patch] convention (see https://github.com/Unidata/netcdf4-python/issues/1090)
29-
# bumping the netCDF4 version is currently blocked by #4491
28+
# netcdf follows a 1.major.minor[.patch] convention
29+
# (see https://github.com/Unidata/netcdf4-python/issues/1090)
30+
# bumping the netCDF4 version is currently blocked by #4491
3031
- netcdf4=1.5.3
3132
- numba=0.49
3233
- numpy=1.17
3334
- pandas=1.0
34-
# - pint # See py37-min-nep18.yml
35+
- pint=0.15
3536
- pip
3637
- pseudonetcdf=3.1
3738
- pydap=3.2
@@ -44,7 +45,7 @@ dependencies:
4445
- scipy=1.4
4546
- seaborn=0.10
4647
- setuptools=40.4
47-
# - sparse # See py37-min-nep18.yml
48+
- sparse=0.8
4849
- toolz=0.10
4950
- zarr=2.4
5051
- pip:

ci/requirements/py37-min-nep18.yml

-22
This file was deleted.

doc/getting-started-guide/installing.rst

+1-10
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ dependencies:
9595
- **setuptools:** 42 months (but no older than 40.4)
9696
- **numpy:** 18 months
9797
(`NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_)
98-
- **dask and dask.distributed:** 12 months
99-
- **sparse, pint** and other libraries that rely on
100-
`NEP-18 <https://numpy.org/neps/nep-0018-array-function-protocol.html>`_
101-
for integration: very latest available versions only, until the technology will have
102-
matured. This extends to dask when used in conjunction with any of these libraries.
103-
numpy >=1.17.
10498
- **all other libraries:** 12 months
10599

106100
This means the latest minor (X.Y) version from N months prior. Patch versions (x.y.Z)
@@ -109,10 +103,7 @@ release is guaranteed to work.
109103

110104
You can see the actual minimum tested versions:
111105

112-
- `For NEP-18 libraries
113-
<https://github.com/pydata/xarray/blob/main/ci/requirements/py37-min-nep18.yml>`_
114-
- `For everything else
115-
<https://github.com/pydata/xarray/blob/main/ci/requirements/py37-min-all-deps.yml>`_
106+
`<https://github.com/pydata/xarray/blob/main/ci/requirements/py37-min-all-deps.yml>`_
116107

117108
.. _installation-instructions:
118109

doc/user-guide/dask.rst

+7-9
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,16 @@ along a particular dimension, an exception is raised when you try to access
259259
arrays in a dataset share the same chunking alignment. Neither of these
260260
are currently done.
261261

262-
NumPy ufuncs like ``np.sin`` currently only work on eagerly evaluated arrays
263-
(this will change with the next major NumPy release). We have provided
264-
replacements that also work on all xarray objects, including those that store
265-
lazy Dask arrays, in the :ref:`xarray.ufuncs <api.ufuncs>` module:
262+
NumPy ufuncs like ``np.sin`` transparently work on all xarray objects, including those
263+
that store lazy Dask arrays:
266264

267265
.. ipython:: python
268266
269-
import xarray.ufuncs as xu
267+
import numpy as np
270268
271-
xu.sin(rechunked)
269+
np.sin(rechunked)
272270
273-
To access Dask arrays directly, use the new
271+
To access Dask arrays directly, use the
274272
:py:attr:`DataArray.data <xarray.DataArray.data>` attribute. This attribute exposes
275273
array data either as a Dask array or as a NumPy array, depending on whether it has been
276274
loaded into Dask or not:
@@ -281,8 +279,8 @@ loaded into Dask or not:
281279
282280
.. note::
283281

284-
In the future, we may extend ``.data`` to support other "computable" array
285-
backends beyond Dask and NumPy (e.g., to support sparse arrays).
282+
``.data`` is also used to expose other "computable" array backends beyond Dask and
283+
NumPy (e.g. sparse and pint arrays).
286284

287285
.. _dask.automatic-parallelization:
288286

requirements.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# it exists to let GitHub build the repository dependency graph
33
# https://help.github.com/en/github/visualizing-repository-data-with-graphs/listing-the-packages-that-a-repository-depends-on
44

5-
numpy >= 1.15
6-
pandas >= 0.25
5+
numpy >= 1.17
6+
pandas >= 1.0
77
setuptools >= 40.4
8+
typing-extensions >= 3.10

xarray/tests/test_ufuncs.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,11 @@ def test_gufuncs():
161161

162162

163163
def test_xarray_ufuncs_deprecation():
164-
with pytest.warns(PendingDeprecationWarning, match="xarray.ufuncs"):
164+
with pytest.warns(FutureWarning, match="xarray.ufuncs"):
165165
xu.cos(xr.DataArray([0, 1]))
166166

167167
with pytest.warns(None) as record:
168168
xu.angle(xr.DataArray([0, 1]))
169-
record = [el.message for el in record if el.category == PendingDeprecationWarning]
170169
assert len(record) == 0
171170

172171

xarray/ufuncs.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ def __init__(self, name):
4646
def __call__(self, *args, **kwargs):
4747
if self._name not in ["angle", "iscomplex"]:
4848
_warnings.warn(
49-
"xarray.ufuncs will be deprecated when xarray no longer "
50-
"supports versions of numpy older than v1.17. Instead, use "
51-
"numpy ufuncs directly.",
52-
PendingDeprecationWarning,
49+
"xarray.ufuncs is deprecated. Instead, use numpy ufuncs directly.",
50+
FutureWarning,
5351
stacklevel=2,
5452
)
5553

0 commit comments

Comments
 (0)