diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index ef02a3e7f23..40ef4a7fc74 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -26,7 +26,7 @@ dependencies: - numba - numbagg - numexpr - - numpy + - numpy>=2 - opt_einsum - packaging - pandas diff --git a/xarray/core/computation.py b/xarray/core/computation.py index 5d21d0836b9..bb7122e82de 100644 --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -23,7 +23,7 @@ from xarray.core.merge import merge_attrs, merge_coordinates_without_align from xarray.core.options import OPTIONS, _get_keep_attrs from xarray.core.types import Dims, T_DataArray -from xarray.core.utils import is_dict_like, is_duck_dask_array, is_scalar, parse_dims +from xarray.core.utils import is_dict_like, is_scalar, parse_dims from xarray.core.variable import Variable from xarray.namedarray.parallelcompat import get_chunked_array_type from xarray.namedarray.pycompat import is_chunked_array @@ -1693,11 +1693,11 @@ def cross( if a.sizes[dim] < b.sizes[dim]: a = a.pad({dim: (0, 1)}, constant_values=0) # TODO: Should pad or apply_ufunc handle correct chunking? - a = a.chunk({dim: -1}) if is_duck_dask_array(a.data) else a + a = a.chunk({dim: -1}) if is_chunked_array(a.data) else a else: b = b.pad({dim: (0, 1)}, constant_values=0) # TODO: Should pad or apply_ufunc handle correct chunking? - b = b.chunk({dim: -1}) if is_duck_dask_array(b.data) else b + b = b.chunk({dim: -1}) if is_chunked_array(b.data) else b else: raise ValueError( f"{dim!r} on {'a' if a.sizes[dim] == 1 else 'b'} is incompatible:" diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py index 8b480b02472..e974b8b1ac8 100644 --- a/xarray/tests/test_computation.py +++ b/xarray/tests/test_computation.py @@ -2547,7 +2547,8 @@ def test_polyfit_polyval_integration( "cartesian", 1, ], - [ # Test 1 sized arrays with coords: + # Test 1 sized arrays with coords: + pytest.param( xr.DataArray( np.array([1]), dims=["cartesian"], @@ -2562,8 +2563,10 @@ def test_polyfit_polyval_integration( np.array([4, 5, 6]), "cartesian", -1, - ], - [ # Test filling in between with coords: + marks=(pytest.mark.xfail(),), + ), + # Test filling in between with coords: + pytest.param( xr.DataArray( [1, 2], dims=["cartesian"], @@ -2578,7 +2581,8 @@ def test_polyfit_polyval_integration( np.array([4, 5, 6]), "cartesian", -1, - ], + marks=(pytest.mark.xfail(),), + ), ], ) def test_cross(a, b, ae, be, dim: str, axis: int, use_dask: bool) -> None: