From d121e78a085f37b5a38dbccba84fafee37f63316 Mon Sep 17 00:00:00 2001 From: Packit Date: Tue, 29 Apr 2025 23:31:59 +0000 Subject: [PATCH] Update to 2025.4.0 upstream release - Resolves: rhbz#2328431 Commit authored by Packit automation (https://packit.dev/) Co-authored-by: Elliott Sales de Andrade --- .gitignore | 1 + ...afe-casts-from-float-to-unsigned-int.patch | 16 +-- ...st_doc_example-on-big-endian-systems.patch | 34 ------ 9945.patch | 102 ------------------ README.packit | 3 + python-xarray.spec | 21 ++-- sources | 2 +- 7 files changed, 22 insertions(+), 157 deletions(-) rename 0002-Avoid-unsafe-casts-from-float-to-unsigned-int.patch => 0001-Avoid-unsafe-casts-from-float-to-unsigned-int.patch (81%) delete mode 100644 0001-Fix-test_doc_example-on-big-endian-systems.patch delete mode 100644 9945.patch create mode 100644 README.packit diff --git a/.gitignore b/.gitignore index 547192a..e3c94b2 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ /xarray-2024.7.0.tar.gz /xarray-2024.10.0.tar.gz /xarray-2025.1.1.tar.gz +/xarray-2025.4.0.tar.gz diff --git a/0002-Avoid-unsafe-casts-from-float-to-unsigned-int.patch b/0001-Avoid-unsafe-casts-from-float-to-unsigned-int.patch similarity index 81% rename from 0002-Avoid-unsafe-casts-from-float-to-unsigned-int.patch rename to 0001-Avoid-unsafe-casts-from-float-to-unsigned-int.patch index 74ebf24..993c3b0 100644 --- a/0002-Avoid-unsafe-casts-from-float-to-unsigned-int.patch +++ b/0001-Avoid-unsafe-casts-from-float-to-unsigned-int.patch @@ -1,7 +1,7 @@ -From e84321150e52a19e617efd7f8798d6859bd3c5e7 Mon Sep 17 00:00:00 2001 +From 7dcc6fb328ff5ca0695a019d00da5714911ab766 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 19 Jan 2025 04:47:23 -0500 -Subject: [PATCH 2/2] Avoid unsafe casts from float to unsigned int +Subject: [PATCH] Avoid unsafe casts from float to unsigned int Fixes #9815 @@ -12,10 +12,10 @@ Signed-off-by: Elliott Sales de Andrade 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/xarray/coding/variables.py b/xarray/coding/variables.py -index 8154f044..355f3b0b 100644 +index 1b7bc95e..814406a2 100644 --- a/xarray/coding/variables.py +++ b/xarray/coding/variables.py -@@ -426,7 +426,10 @@ class CFMaskCoder(VariableCoder): +@@ -345,7 +345,10 @@ class CFMaskCoder(VariableCoder): if fill_value is not None and has_unsigned: pop_to(encoding, attrs, "_Unsigned") # XXX: Is this actually needed? Doesn't the backend handle this? @@ -28,11 +28,11 @@ index 8154f044..355f3b0b 100644 return Variable(dims, data, attrs, encoding, fastpath=True) diff --git a/xarray/core/duck_array_ops.py b/xarray/core/duck_array_ops.py -index 7e7333fd..be842b66 100644 +index 96330a64..268dbe4d 100644 --- a/xarray/core/duck_array_ops.py +++ b/xarray/core/duck_array_ops.py -@@ -236,6 +236,16 @@ def astype(data, dtype, **kwargs): - return data.astype(dtype, **kwargs) +@@ -238,6 +238,16 @@ def astype(data, dtype, *, xp=None, **kwargs): + return xp.astype(data, dtype, **kwargs) +def view(data, *args, **kwargs): @@ -49,5 +49,5 @@ index 7e7333fd..be842b66 100644 converted = data if is_duck_array(data) else xp.asarray(data) -- -2.47.0 +2.49.0 diff --git a/0001-Fix-test_doc_example-on-big-endian-systems.patch b/0001-Fix-test_doc_example-on-big-endian-systems.patch deleted file mode 100644 index d6ea5ea..0000000 --- a/0001-Fix-test_doc_example-on-big-endian-systems.patch +++ /dev/null @@ -1,34 +0,0 @@ -From f41100ae4202dce5891854143ba3a31f4e2d5a6d Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Tue, 14 Jan 2025 02:46:39 -0500 -Subject: [PATCH 1/2] Fix test_doc_example on big-endian systems - -... by using a fixed-endian input. - -Signed-off-by: Elliott Sales de Andrade ---- - xarray/tests/test_datatree.py | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/xarray/tests/test_datatree.py b/xarray/tests/test_datatree.py -index 7b295128..21870050 100644 ---- a/xarray/tests/test_datatree.py -+++ b/xarray/tests/test_datatree.py -@@ -1240,8 +1240,12 @@ class TestRepr: - ) - def test_doc_example(self) -> None: - # regression test for https://github.com/pydata/xarray/issues/9499 -- time = xr.DataArray(data=["2022-01", "2023-01"], dims="time") -- stations = xr.DataArray(data=list("abcdef"), dims="station") -+ time = xr.DataArray( -+ data=np.array(["2022-01", "2023-01"], dtype=" -Date: Mon, 13 Jan 2025 08:00:50 -0600 -Subject: [PATCH 1/2] Remove outdated quantile test. - -dask now auto-rechunks for quantile. - -Closes #9860 ---- - xarray/tests/test_groupby.py | 18 ++++++++++-------- - 1 file changed, 10 insertions(+), 8 deletions(-) - -diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py -index e4383dd58a9..2349ff0adfd 100644 ---- a/xarray/tests/test_groupby.py -+++ b/xarray/tests/test_groupby.py -@@ -284,7 +284,6 @@ def test_da_groupby_empty() -> None: - - @requires_dask - def test_dask_da_groupby_quantile() -> None: -- # Only works when the grouped reduction can run blockwise - # Scalar quantile - expected = xr.DataArray( - data=[2, 5], coords={"x": [1, 2], "quantile": 0.5}, dims="x" -@@ -292,8 +291,6 @@ def test_dask_da_groupby_quantile() -> None: - array = xr.DataArray( - data=[1, 2, 3, 4, 5, 6], coords={"x": [1, 1, 1, 2, 2, 2]}, dims="x" - ) -- with pytest.raises(ValueError): -- array.chunk(x=1).groupby("x").quantile(0.5) - - # will work blockwise with flox - actual = array.chunk(x=3).groupby("x").quantile(0.5) -@@ -327,7 +324,8 @@ def test_dask_da_groupby_median() -> None: - assert_identical(expected, actual) - - --def test_da_groupby_quantile() -> None: -+@pytest.mark.parametrize("use_flox", [True, False]) -+def test_da_groupby_quantile(use_flox) -> None: - array = xr.DataArray( - data=[1, 2, 3, 4, 5, 6], coords={"x": [1, 1, 1, 2, 2, 2]}, dims="x" - ) -@@ -336,8 +334,10 @@ def test_da_groupby_quantile() -> None: - expected = xr.DataArray( - data=[2, 5], coords={"x": [1, 2], "quantile": 0.5}, dims="x" - ) -- actual = array.groupby("x").quantile(0.5) -- assert_identical(expected, actual) -+ -+ with xr.set_options(use_flox=use_flox): -+ actual = array.groupby("x").quantile(0.5) -+ assert_identical(expected, actual) - - # Vector quantile - expected = xr.DataArray( -@@ -345,7 +345,8 @@ def test_da_groupby_quantile() -> None: - coords={"x": [1, 2], "quantile": [0, 1]}, - dims=("x", "quantile"), - ) -- actual = array.groupby("x").quantile([0, 1]) -+ with xr.set_options(use_flox=use_flox): -+ actual = array.groupby("x").quantile([0, 1]) - assert_identical(expected, actual) - - array = xr.DataArray( -@@ -356,7 +357,8 @@ def test_da_groupby_quantile() -> None: - e = [np.nan, 5] if skipna is False else [2.5, 5] - - expected = xr.DataArray(data=e, coords={"x": [1, 2], "quantile": 0.5}, dims="x") -- actual = array.groupby("x").quantile(0.5, skipna=skipna) -+ with xr.set_options(use_flox=use_flox): -+ actual = array.groupby("x").quantile(0.5, skipna=skipna) - assert_identical(expected, actual) - - # Multiple dimensions - -From 3d6e76a29a328489b0867a89fce1c157605c5f5d Mon Sep 17 00:00:00 2001 -From: Deepak Cherian -Date: Mon, 13 Jan 2025 10:28:29 -0600 -Subject: [PATCH 2/2] Apply suggestions from code review - -Co-authored-by: Michael Niklas ---- - xarray/tests/test_groupby.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py -index 2349ff0adfd..7dd6cdb622d 100644 ---- a/xarray/tests/test_groupby.py -+++ b/xarray/tests/test_groupby.py -@@ -324,8 +324,8 @@ def test_dask_da_groupby_median() -> None: - assert_identical(expected, actual) - - --@pytest.mark.parametrize("use_flox", [True, False]) --def test_da_groupby_quantile(use_flox) -> None: -+@pytest.mark.parametrize("use_flox", [pytest.param(True, marks=requires_flox), False]) -+def test_da_groupby_quantile(use_flox: bool) -> None: - array = xr.DataArray( - data=[1, 2, 3, 4, 5, 6], coords={"x": [1, 1, 1, 2, 2, 2]}, dims="x" - ) diff --git a/README.packit b/README.packit new file mode 100644 index 0000000..807ffc6 --- /dev/null +++ b/README.packit @@ -0,0 +1,3 @@ +This repository is maintained by packit. +https://packit.dev/ +The file was generated using packit 1.6.0.post1.dev2+gd5a7662a. diff --git a/python-xarray.spec b/python-xarray.spec index 601ed47..16404cd 100644 --- a/python-xarray.spec +++ b/python-xarray.spec @@ -1,7 +1,7 @@ %global srcname xarray Name: python-%{srcname} -Version: 2025.1.1 +Version: 2025.4.0 Release: %autorelease Summary: N-D labeled arrays and datasets in Python @@ -9,25 +9,20 @@ License: Apache-2.0 URL: https://github.com/pydata/xarray Source: %pypi_source %{srcname} -# Fix test_dask_da_groupby_quantile. -Patch: https://github.com/pydata/xarray/pull/9945.patch - -# https://github.com/pydata/xarray/pull/9949 -Patch: 0001-Fix-test_doc_example-on-big-endian-systems.patch # https://github.com/pydata/xarray/pull/9964 -Patch: 0002-Avoid-unsafe-casts-from-float-to-unsigned-int.patch +Patch: 0001-Avoid-unsafe-casts-from-float-to-unsigned-int.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(bottleneck) -BuildRequires: python3dist(dask[array]) >= 2023.9 -BuildRequires: python3dist(dask[dataframe]) >= 2023.9 -BuildRequires: python3dist(pint) >= 0.16 +BuildRequires: python3dist(dask[array]) >= 2023.11 +BuildRequires: python3dist(dask[dataframe]) >= 2023.11 +BuildRequires: python3dist(pint) >= 0.22 BuildRequires: python3dist(pytest) >= 2.7.1 BuildRequires: python3dist(pytest-xdist) -BuildRequires: python3dist(rasterio) >= 1.1 -BuildRequires: python3dist(seaborn) >= 0.11 +BuildRequires: python3dist(rasterio) >= 1.3 +BuildRequires: python3dist(seaborn) >= 0.13 %global _description %{expand: \ Xarray (formerly xray) is an open source project and Python package that @@ -69,6 +64,8 @@ Summary: %{summary} %check rm -rf xarray +echo >> pytest.ini # Ignore any command-line arguments from upstream. + pytest_args=( -n auto -m "not network" diff --git a/sources b/sources index a602475..e0b352e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xarray-2025.1.1.tar.gz) = a0cde2c8e38887878bcde25fd3ea6ee436b522ca73f52359d2c8ac1993447472d7cd5e5d4b11016ec48d1b86dba08e9207caf00b2b43ab896c777395e51f7943 +SHA512 (xarray-2025.4.0.tar.gz) = 8018bf2431f30194d057e363f8a72fb7ef99834ae14daec5b98e5e101b42c7b1199d583eb9621c9955830bb15b3c197b08e71c6a299abeb42a6a215a57ea5995