Skip to content

Commit 697fd15

Browse files
authored
temporarily silence shape assignment warnings raised in netCDF4 (#11146)
* use an explicit slice instead of ellipses * [run-upstream] * [test-upstream] * typo * back to ellipsis assignment * ignore the shape assignment warning raised for netcdf4 * ignore in the other files using netcdf, as well
1 parent 2742e22 commit 697fd15

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ filterwarnings = [
344344
# Zarr V3 data type specifications warnings - very repetitive
345345
"ignore:The data type .* does not have a Zarr V3 specification",
346346
"ignore:Consolidated metadata is currently not part",
347+
# raised by `numpy` for code in `netcdf4-python`
348+
"ignore:Setting the shape on a NumPy array has been deprecated in NumPy 2.5.::xarray.backends.netCDF4_",
349+
"ignore:Setting the shape on a NumPy array has been deprecated in NumPy 2.5.::xarray.tests.test_backends",
350+
"ignore:Setting the shape on a NumPy array has been deprecated in NumPy 2.5.::xarray.tests.test_backends_datatree",
347351
# TODO: remove once we know how to deal with a changed signature in protocols
348352
"default:::xarray.tests.test_strategies",
349353
]

xarray/tests/test_backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7229,7 +7229,7 @@ def test_open_dataset_chunking_zarr(chunks, tmp_path: Path) -> None:
72297229
"chunks", ["auto", -1, {}, {"x": "auto"}, {"x": -1}, {"x": "auto", "y": -1}]
72307230
)
72317231
@pytest.mark.filterwarnings("ignore:The specified chunks separate")
7232-
def test_chunking_consintency(chunks, tmp_path: Path) -> None:
7232+
def test_chunking_consistency(chunks, tmp_path: Path) -> None:
72337233
encoded_chunks: dict[str, Any] = {}
72347234
dask_arr = da.from_array(
72357235
np.ones((500, 500), dtype="float64"), chunks=encoded_chunks

0 commit comments

Comments
 (0)