Skip to content

Commit bd9495f

Browse files
authored
upstream-dev CI: Fix interp and cumtrapz (#8861)
1 parent 84dc961 commit bd9495f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

xarray/tests/test_dataset.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -7052,12 +7052,10 @@ def test_cumulative_integrate(dask) -> None:
70527052
# along x
70537053
actual = da.cumulative_integrate("x")
70547054

7055-
# From scipy-1.6.0 cumtrapz is renamed to cumulative_trapezoid, but cumtrapz is
7056-
# still provided for backward compatibility
7057-
from scipy.integrate import cumtrapz
7055+
from scipy.integrate import cumulative_trapezoid
70587056

70597057
expected_x = xr.DataArray(
7060-
cumtrapz(da.compute(), da["x"], axis=0, initial=0.0),
7058+
cumulative_trapezoid(da.compute(), da["x"], axis=0, initial=0.0),
70617059
dims=["x", "y"],
70627060
coords=da.coords,
70637061
)
@@ -7073,7 +7071,7 @@ def test_cumulative_integrate(dask) -> None:
70737071
# along y
70747072
actual = da.cumulative_integrate("y")
70757073
expected_y = xr.DataArray(
7076-
cumtrapz(da, da["y"], axis=1, initial=0.0),
7074+
cumulative_trapezoid(da, da["y"], axis=1, initial=0.0),
70777075
dims=["x", "y"],
70787076
coords=da.coords,
70797077
)

xarray/tests/test_interp.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,9 @@ def test_interpolate_chunk_1d(
833833

834834
dest[dim] = cast(
835835
xr.DataArray,
836-
np.linspace(before, after, len(da.coords[dim]) * 13),
836+
np.linspace(
837+
before.item(), after.item(), len(da.coords[dim]) * 13
838+
),
837839
)
838840
if chunked:
839841
dest[dim] = xr.DataArray(data=dest[dim], dims=[dim])

0 commit comments

Comments
 (0)