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 <quantum.analyst@gmail.com>
This commit is contained in:
Packit
2025-04-29 23:31:59 +00:00
committed by Elliott Sales de Andrade
parent 6e553d61be
commit d121e78a08
7 changed files with 22 additions and 157 deletions
+1
View File
@@ -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
@@ -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 <quantum.analyst@gmail.com>
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 <quantum.analyst@gmail.com>
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
@@ -1,34 +0,0 @@
From f41100ae4202dce5891854143ba3a31f4e2d5a6d Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
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 <quantum.analyst@gmail.com>
---
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="<U7"), dims="time"
+ )
+ stations = xr.DataArray(
+ data=np.array(list("abcdef"), dtype="<U1"), dims="station"
+ )
lon = [-100, -80, -60]
lat = [10, 20, 30]
# Set up fake data
--
2.47.0
-102
View File
@@ -1,102 +0,0 @@
From da4aa1f2f116089c75adee5954bcc9ab755bcb89 Mon Sep 17 00:00:00 2001
From: Deepak Cherian <deepak@cherian.net>
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 <dcherian@users.noreply.github.com>
Date: Mon, 13 Jan 2025 10:28:29 -0600
Subject: [PATCH 2/2] Apply suggestions from code review
Co-authored-by: Michael Niklas <mick.niklas@gmail.com>
---
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"
)
+3
View File
@@ -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.
+9 -12
View File
@@ -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"
+1 -1
View File
@@ -1 +1 @@
SHA512 (xarray-2025.1.1.tar.gz) = a0cde2c8e38887878bcde25fd3ea6ee436b522ca73f52359d2c8ac1993447472d7cd5e5d4b11016ec48d1b86dba08e9207caf00b2b43ab896c777395e51f7943
SHA512 (xarray-2025.4.0.tar.gz) = 8018bf2431f30194d057e363f8a72fb7ef99834ae14daec5b98e5e101b42c7b1199d583eb9621c9955830bb15b3c197b08e71c6a299abeb42a6a215a57ea5995