diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index d2b8634b8b9..19b7ef7292c 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -7052,12 +7052,10 @@ def test_cumulative_integrate(dask) -> None: # along x actual = da.cumulative_integrate("x") - # From scipy-1.6.0 cumtrapz is renamed to cumulative_trapezoid, but cumtrapz is - # still provided for backward compatibility - from scipy.integrate import cumtrapz + from scipy.integrate import cumulative_trapezoid expected_x = xr.DataArray( - cumtrapz(da.compute(), da["x"], axis=0, initial=0.0), + cumulative_trapezoid(da.compute(), da["x"], axis=0, initial=0.0), dims=["x", "y"], coords=da.coords, ) @@ -7073,7 +7071,7 @@ def test_cumulative_integrate(dask) -> None: # along y actual = da.cumulative_integrate("y") expected_y = xr.DataArray( - cumtrapz(da, da["y"], axis=1, initial=0.0), + cumulative_trapezoid(da, da["y"], axis=1, initial=0.0), dims=["x", "y"], coords=da.coords, ) diff --git a/xarray/tests/test_interp.py b/xarray/tests/test_interp.py index a7644ac9d2b..7151c669fbc 100644 --- a/xarray/tests/test_interp.py +++ b/xarray/tests/test_interp.py @@ -833,7 +833,9 @@ def test_interpolate_chunk_1d( dest[dim] = cast( xr.DataArray, - np.linspace(before, after, len(da.coords[dim]) * 13), + np.linspace( + before.item(), after.item(), len(da.coords[dim]) * 13 + ), ) if chunked: dest[dim] = xr.DataArray(data=dest[dim], dims=[dim])