Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upstream-dev CI: Fix interp and cumtrapz #8861

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions xarray/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand Down
4 changes: 3 additions & 1 deletion xarray/tests/test_interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
Loading