forked from pool/python-xarray
* Add test for rechunking to a size string by @dcherian in #9117 * Update docstring in api.py for open_mfdataset(), clarifying "chunks" argument by @arthur-e in #9121 * Grouper refactor by @dcherian in #9122 * adjust repr tests to account for different platforms (#9127) by @mgorny in #9128 * Support duplicate dimensions in .chunk by @mraspaud in #9099 * Update zendoo badge link by @max-sixty in #9133 * Split out distributed writes in zarr docs by @max-sixty in #9132 * Improve to_zarr docs by @max-sixty in #9139 * groupby: remove some internal use of IndexVariable by @dcherian in #9123 * Improve zarr chunks docs by @max-sixty in #9140 * Include numbagg in type checks by @max-sixty in #9159 * Remove mypy exclusions for a couple more libraries by @max-sixty in #9160 * Add test for #9155 by @max-sixty in #9161 * switch to datetime unit "D" by @keewis in #9170 * Slightly improve DataTree repr by @shoyer in #9064 * Fix example code formatting for CachingFileManager by @djhoese in #9178 * Change np.core.defchararray to np.char (#9165) by @pont-us in #9166 * temporarily remove pydap from CI by @keewis in #9183 * also pin numpy in the all-but-dask CI by @keewis in #9184 * promote floating-point numeric datetimes to 64-bit before decoding by @keewis in #9182 * "source" encoding for datasets opened from fsspec objects by OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-xarray?expand=0&rev=99
99 lines
3.6 KiB
Diff
99 lines
3.6 KiB
Diff
From 70e3f30d5a636f6d847acb2dd0d12cffeb601d41 Mon Sep 17 00:00:00 2001
|
|
From: Deepak Cherian <deepak@cherian.net>
|
|
Date: Tue, 13 Aug 2024 19:47:10 -0600
|
|
Subject: [PATCH 1/2] xfail np.cross tests
|
|
|
|
xref #9327
|
|
---
|
|
xarray/core/computation.py | 6 +++---
|
|
xarray/tests/test_computation.py | 12 ++++++++----
|
|
2 files changed, 11 insertions(+), 7 deletions(-)
|
|
|
|
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:
|
|
|
|
From deb9e3266ca163575b200960c14c87fc999dcfc6 Mon Sep 17 00:00:00 2001
|
|
From: Deepak Cherian <deepak@cherian.net>
|
|
Date: Tue, 13 Aug 2024 19:49:56 -0600
|
|
Subject: [PATCH 2/2] Force numpy>=2
|
|
|
|
---
|
|
ci/requirements/environment.yml | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
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
|