Skip to content

Commit c94d9c2

Browse files
committed
Merge branch 'main' into grouper-public-api
* main: exclude the bots from the release notes (pydata#9235) switch the documentation to run with `numpy>=2` (pydata#9177) `numpy` 2 compatibility in the iris code paths (pydata#9156) `numpy` 2 compatibility in the `netcdf4` and `h5netcdf` backends (pydata#9136) Fix time indexing regression in `convert_calendar` (pydata#9192) Use duckarray assertions in test_coding_times (pydata#9226) Use reshape and ravel from duck_array_ops in coding/times.py (pydata#9225) Cleanup test_coding_times.py (pydata#9223) Only use necessary dims when creating temporary dataarray (pydata#9206) Fix two bugs in DataTree.update() (pydata#9214) Use numpy 2.0-compat `np.complex64` dtype in test (pydata#9217)
2 parents 1142663 + a69815f commit c94d9c2

25 files changed

+275
-172
lines changed

.github/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- dependabot
5+
- pre-commit-ci

ci/install-upstream-wheels.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $conda remove -y numba numbagg sparse
1313
# temporarily remove numexpr
1414
$conda remove -y numexpr
1515
# temporarily remove backends
16-
$conda remove -y cf_units hdf5 h5py netcdf4 pydap
16+
$conda remove -y pydap
1717
# forcibly remove packages to avoid artifacts
1818
$conda remove -y --force \
1919
numpy \
@@ -37,8 +37,7 @@ python -m pip install \
3737
numpy \
3838
scipy \
3939
matplotlib \
40-
pandas \
41-
h5py
40+
pandas
4241
# for some reason pandas depends on pyarrow already.
4342
# Remove once a `pyarrow` version compiled with `numpy>=2.0` is on `conda-forge`
4443
python -m pip install \

ci/requirements/all-but-dask.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- netcdf4
2323
- numba
2424
- numbagg
25-
- numpy<2
25+
- numpy
2626
- packaging
2727
- pandas
2828
- pint>=0.22

ci/requirements/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- nbsphinx
2222
- netcdf4>=1.5
2323
- numba
24-
- numpy>=1.21,<2
24+
- numpy>=2
2525
- packaging>=21.3
2626
- pandas>=1.4,!=2.1.0
2727
- pooch

ci/requirements/environment-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies:
2323
- netcdf4
2424
- numba
2525
- numbagg
26-
- numpy<2
26+
- numpy
2727
- packaging
2828
- pandas
2929
# - pint>=0.22

ci/requirements/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies:
2626
- numba
2727
- numbagg
2828
- numexpr
29-
- numpy<2
29+
- numpy
3030
- opt_einsum
3131
- packaging
3232
- pandas

doc/getting-started-guide/faq.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,9 @@ Some packages may have additional functionality beyond what is shown here. You c
352352
How does xarray handle missing values?
353353
--------------------------------------
354354

355-
**xarray can handle missing values using ``np.NaN``**
355+
**xarray can handle missing values using ``np.nan``**
356356

357-
- ``np.NaN`` is used to represent missing values in labeled arrays and datasets. It is a commonly used standard for representing missing or undefined numerical data in scientific computing. ``np.NaN`` is a constant value in NumPy that represents "Not a Number" or missing values.
357+
- ``np.nan`` is used to represent missing values in labeled arrays and datasets. It is a commonly used standard for representing missing or undefined numerical data in scientific computing. ``np.nan`` is a constant value in NumPy that represents "Not a Number" or missing values.
358358

359359
- Most of xarray's computation methods are designed to automatically handle missing values appropriately.
360360

doc/user-guide/computation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ However, the functions also take missing values in the data into account:
426426

427427
.. ipython:: python
428428
429-
data = xr.DataArray([np.NaN, 2, 4])
429+
data = xr.DataArray([np.nan, 2, 4])
430430
weights = xr.DataArray([8, 1, 1])
431431
432432
data.weighted(weights).mean()
@@ -444,7 +444,7 @@ If the weights add up to to 0, ``sum`` returns 0:
444444
445445
data.weighted(weights).sum()
446446
447-
and ``mean``, ``std`` and ``var`` return ``NaN``:
447+
and ``mean``, ``std`` and ``var`` return ``nan``:
448448

449449
.. ipython:: python
450450

doc/user-guide/interpolation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ Let's see how :py:meth:`~xarray.DataArray.interp` works on real data.
292292
axes[0].set_title("Raw data")
293293
294294
# Interpolated data
295-
new_lon = np.linspace(ds.lon[0], ds.lon[-1], ds.sizes["lon"] * 4)
296-
new_lat = np.linspace(ds.lat[0], ds.lat[-1], ds.sizes["lat"] * 4)
295+
new_lon = np.linspace(ds.lon[0].item(), ds.lon[-1].item(), ds.sizes["lon"] * 4)
296+
new_lat = np.linspace(ds.lat[0].item(), ds.lat[-1].item(), ds.sizes["lat"] * 4)
297297
dsi = ds.interp(lat=new_lat, lon=new_lon)
298298
dsi.air.plot(ax=axes[1])
299299
@savefig interpolation_sample3.png width=8in

doc/user-guide/testing.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,10 @@ If the array type you want to generate has an array API-compliant top-level name
239239
you can use this neat trick:
240240

241241
.. ipython:: python
242-
:okwarning:
243242
244-
from numpy import array_api as xp # available in numpy 1.26.0
243+
import numpy as xp # compatible in numpy 2.0
244+
245+
# use `import numpy.array_api as xp` in numpy>=1.23,<2.0
245246
246247
from hypothesis.extra.array_api import make_strategies_namespace
247248

0 commit comments

Comments
 (0)