From 66c2059622147695f08c918777f70ca21b0daa8d Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 10 Jun 2025 17:05:51 -0400 Subject: [PATCH] Update to 2025.1.2 --- ...afe-casts-from-float-to-unsigned-int.patch | 10 +- ...st_doc_example-on-big-endian-systems.patch | 34 ------ 9945.patch | 102 ------------------ python-xarray.spec | 9 +- 4 files changed, 7 insertions(+), 148 deletions(-) rename 0002-Avoid-unsafe-casts-from-float-to-unsigned-int.patch => 0001-Avoid-unsafe-casts-from-float-to-unsigned-int.patch (89%) delete mode 100644 0001-Fix-test_doc_example-on-big-endian-systems.patch delete mode 100644 9945.patch 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 89% 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..a72912b 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 33ab61521498550eda98d7aebc141635f9f218d7 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,7 +12,7 @@ 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 83112628..b036fd5d 100644 --- a/xarray/coding/variables.py +++ b/xarray/coding/variables.py @@ -426,7 +426,10 @@ class CFMaskCoder(VariableCoder): @@ -28,7 +28,7 @@ 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 c3f15980..1cec78cb 100644 --- a/xarray/core/duck_array_ops.py +++ b/xarray/core/duck_array_ops.py @@ -236,6 +236,16 @@ def astype(data, dtype, **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/python-xarray.spec b/python-xarray.spec index 601ed47..f9e9db9 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.1.2 Release: %autorelease Summary: N-D labeled arrays and datasets in Python @@ -9,13 +9,8 @@ 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