Skip to content

Commit

Permalink
Fix min scipy
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Sep 24, 2024
1 parent 9c33edf commit c8c346c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions xarray/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def _importorskip(

has_matplotlib, requires_matplotlib = _importorskip("matplotlib")
has_scipy, requires_scipy = _importorskip("scipy")
has_scipy_ge_1_13, requires_scipy_ge_1_13 = _importorskip("scipy", "1.13")
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
Expand Down
16 changes: 11 additions & 5 deletions xarray/tests/test_interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
assert_identical,
has_dask,
has_scipy,
has_scipy_ge_1_13,
requires_cftime,
requires_dask,
requires_scipy,
Expand Down Expand Up @@ -137,18 +138,23 @@ def func(obj, new_x):
(
(False, "linear"),
(False, "akima"),
(False, "makima"),
(True, "linear"),
pytest.param(
False,
"makima",
marks=pytest.mark.skipif(not has_scipy_ge_1_13, reason="scipy too old"),
),
pytest.param(
True,
"linear",
marks=pytest.mark.skipif(not has_dask, reason="dask not available"),
),
(True, "akima"),
),
)
def test_interpolate_vectorize(use_dask: bool, method: str) -> None:
if not has_scipy:
pytest.skip("scipy is not installed.")

if not has_dask and use_dask:
pytest.skip("dask is not installed in the environment.")

# scipy interpolation for the reference
def func(obj, dim, new_x, method):
scipy_kwargs = {}
Expand Down

0 comments on commit c8c346c

Please sign in to comment.