14 Commits
f37 ... f42

Author SHA1 Message Date
Elliott Sales de Andrade
66c2059622 Update to 2025.1.2 2025-06-10 17:05:51 -04:00
Elliott Sales de Andrade
6e553d61be Fix additional architecture-specific bugs 2025-01-19 06:08:30 -05:00
Fedora Release Engineering
ffa3ac90cb Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-18 20:49:57 +00:00
Elliott Sales de Andrade
68a87599ce Update to latest version (#2328431)
- Remove doc subpackage; it's been disabled for a while
2025-01-13 22:32:01 -05:00
Elliott Sales de Andrade
c40c2b8108 Add Packit configuration 2025-01-13 22:31:41 -05:00
Elliott Sales de Andrade
7aca2e8d68 Update to latest version (#2245099) 2024-11-11 07:09:04 -05:00
Elliott Sales de Andrade
b4a8abb2fc Fix tests on big-endian systems
Also, remove a redundant skip, as the listed test is skipped by upstream
already.
2024-08-19 01:35:57 -04:00
Elliott Sales de Andrade
4a8ca0c05d Update to latest version (#2245099) 2024-08-18 23:42:52 -04:00
Fedora Release Engineering
28752f8893 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-19 17:09:28 +00:00
Adam Williamson
f24a6d1c9b Update to latest upstream release, disable a failing test 2024-06-18 01:15:38 -07:00
Gwyn Ciesla
362dcc1ead Python 3.13 rebuild 2024-06-13 08:42:23 -05:00
Fedora Release Engineering
0d92610f0c Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-26 13:04:16 +00:00
Fedora Release Engineering
e61d64d3e4 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-22 09:05:39 +00:00
Elliott Sales de Andrade
e75d5c9d07 Update to latest version (#2240764) 2023-09-27 04:11:28 -04:00
8 changed files with 90 additions and 172 deletions

5
.gitignore vendored
View File

@@ -24,3 +24,8 @@
/xarray-data-7d8290e0be9d2a8f4b4381641f20a97db6eaea3d.tar.gz
/xarray-2023.7.0.tar.gz
/xarray-2023.8.0.tar.gz
/xarray-2023.9.0.tar.gz
/xarray-2024.6.0.tar.gz
/xarray-2024.7.0.tar.gz
/xarray-2024.10.0.tar.gz
/xarray-2025.1.1.tar.gz

18
.packit.yaml Normal file
View File

@@ -0,0 +1,18 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/
---
jobs:
- job: pull_from_upstream
trigger: release
dist_git_branches:
rawhide:
fast_forward_merge_into:
- fedora-branched
- job: koji_build
trigger: commit
dist_git_branches:
- fedora-all
- job: bodhi_update
trigger: commit
dist_git_branches:
- fedora-all

View File

@@ -0,0 +1,53 @@
From 33ab61521498550eda98d7aebc141635f9f218d7 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] Avoid unsafe casts from float to unsigned int
Fixes #9815
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
xarray/coding/variables.py | 5 ++++-
xarray/core/duck_array_ops.py | 10 ++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/xarray/coding/variables.py b/xarray/coding/variables.py
index 83112628..b036fd5d 100644
--- a/xarray/coding/variables.py
+++ b/xarray/coding/variables.py
@@ -426,7 +426,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?
- data = duck_array_ops.astype(duck_array_ops.around(data), dtype)
+ signed_dtype = np.dtype(f"i{dtype.itemsize}")
+ data = duck_array_ops.view(
+ duck_array_ops.astype(duck_array_ops.around(data), signed_dtype), dtype
+ )
attrs["_FillValue"] = fill_value
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 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):
return data.astype(dtype, **kwargs)
+def view(data, *args, **kwargs):
+ if hasattr(data, "__array_namespace__"):
+ xp = get_array_namespace(data)
+ if xp == np:
+ # numpy currently doesn't have a view:
+ return data.view(*args, **kwargs)
+ return xp.view(data, *args, **kwargs)
+ return data.view(*args, **kwargs)
+
+
def asarray(data, xp=np, dtype=None):
converted = data if is_duck_array(data) else xp.asarray(data)
--
2.49.0

View File

@@ -1,33 +0,0 @@
From f2b1952202db32b956566648dec4cfd302f54316 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 15 Mar 2019 22:48:25 -0400
Subject: [PATCH 1/2] DOC: Skip examples using unpackaged dependencies.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
doc/user-guide/io.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/doc/user-guide/io.rst b/doc/user-guide/io.rst
index dc495b9f..e03080a1 100644
--- a/doc/user-guide/io.rst
+++ b/doc/user-guide/io.rst
@@ -921,6 +921,7 @@ installed, xarray can convert a ``DataArray`` into a ``Cube`` using
:py:meth:`DataArray.to_iris`:
.. ipython:: python
+ :verbatim:
da = xr.DataArray(
np.random.rand(4, 5),
@@ -935,6 +936,7 @@ Conversely, we can create a new ``DataArray`` object from a ``Cube`` using
:py:meth:`DataArray.from_iris`:
.. ipython:: python
+ :verbatim:
da_cube = xr.DataArray.from_iris(cube)
da_cube
--
2.39.2

View File

@@ -1,39 +0,0 @@
From f85d7fd7257f3c109987022e35f81da24a32bdbf Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 16 Mar 2019 02:59:15 -0400
Subject: [PATCH 2/2] DOC: Don't print out conda/pip environment.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
doc/conf.py | 8 --------
1 file changed, 8 deletions(-)
diff --git a/doc/conf.py b/doc/conf.py
index eb861004..faed9753 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -16,7 +16,6 @@ import datetime
import inspect
import os
import pathlib
-import subprocess
import sys
from contextlib import suppress
from textwrap import dedent, indent
@@ -35,13 +34,6 @@ allowed_failures = set()
print("python exec:", sys.executable)
print("sys.path:", sys.path)
-if "CONDA_DEFAULT_ENV" in os.environ or "conda" in sys.executable:
- print("conda environment:")
- subprocess.run([os.environ.get("CONDA_EXE", "conda"), "list"])
-else:
- print("pip environment:")
- subprocess.run([sys.executable, "-m", "pip", "list"])
-
print(f"xarray: {xarray.__version__}, {xarray.__file__}")
with suppress(ImportError):
--
2.39.2

View File

@@ -1,29 +0,0 @@
From c7391fca66e1fd24b175cfffab692af20628fe2b Mon Sep 17 00:00:00 2001
From: Kyle Sunden <git@ksunden.space>
Date: Thu, 14 Sep 2023 20:18:04 -0500
Subject: [PATCH] Update contourf call check for mpl 3.8
---
xarray/tests/test_plot.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py
index 8b2dfbdec4..a6c15a8600 100644
--- a/xarray/tests/test_plot.py
+++ b/xarray/tests/test_plot.py
@@ -167,7 +167,14 @@ def imshow_called(self, plotmethod):
def contourf_called(self, plotmethod):
plotmethod()
- paths = plt.gca().findobj(mpl.collections.PathCollection)
+
+ # Compatible with mpl before (PathCollection) and after (QuadContourSet) 3.8
+ def matchfunc(x):
+ return isinstance(
+ x, (mpl.collections.PathCollection, mpl.contour.QuadContourSet)
+ )
+
+ paths = plt.gca().findobj(matchfunc)
return len(paths) > 0

View File

@@ -1,38 +1,28 @@
%global srcname xarray
%global data_commit 7d8290e0be9d2a8f4b4381641f20a97db6eaea3d
%bcond_with docs
Name: python-%{srcname}
Version: 2023.8.0
Version: 2025.1.2
Release: %autorelease
Summary: N-D labeled arrays and datasets in Python
License: Apache-2.0
URL: https://github.com/pydata/xarray
Source0: %pypi_source %{srcname}
# Data for examples only.
Source1: https://github.com/pydata/xarray-data/archive/%{data_commit}/xarray-data-%{data_commit}.tar.gz
# All Fedora specific.
Patch0001: 0001-DOC-Skip-examples-using-unpackaged-dependencies.patch
Patch0002: 0002-DOC-Don-t-print-out-conda-pip-environment.patch
# Fix tests with Matplotlib 3.8.0.
Patch0003: https://github.com/pydata/xarray/pull/8186.patch
Source: %pypi_source %{srcname}
# https://github.com/pydata/xarray/pull/9964
Patch: 0001-Avoid-unsafe-casts-from-float-to-unsigned-int.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3dist(bottleneck)
BuildRequires: python3dist(cftime) >= 1.2
BuildRequires: python3dist(dask[array]) >= 2.30
BuildRequires: python3dist(dask[dataframe]) >= 2.30
BuildRequires: python3dist(netcdf4) >= 1.5
BuildRequires: python3dist(dask[array]) >= 2023.9
BuildRequires: python3dist(dask[dataframe]) >= 2023.9
BuildRequires: python3dist(pint) >= 0.16
BuildRequires: python3dist(pytest) >= 2.7.1
BuildRequires: python3dist(pytest-xdist)
BuildRequires: python3dist(rasterio) >= 1.1
BuildRequires: python3dist(seaborn) >= 0.11
BuildRequires: python3dist(zarr) >= 2.5
%global _description %{expand: \
Xarray (formerly xray) is an open source project and Python package that
@@ -52,62 +42,24 @@ data model, and integrates tightly with dask for parallel computing.}
%description %{_description}
%package -n python3-%{srcname}
Summary: %{summary}
%description -n python3-%{srcname} %{_description}
%if %{with docs}
%package -n python-%{srcname}-doc
Summary: xarray documentation
BuildRequires: python3dist(cartopy)
BuildRequires: natural-earth-map-data-110m
BuildRequires: natural-earth-map-data-10m
BuildRequires: python3-ipython-sphinx
BuildRequires: python3dist(jupyter-client)
BuildRequires: python3dist(matplotlib) >= 3.3
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-gallery)
BuildRequires: python3dist(sphinx-rtd-theme)
%description -n python-%{srcname}-doc
Documentation for xarray
%endif
%pyproject_extras_subpkg -n python3-%{srcname} io
%prep
%autosetup -n %{srcname}-%{version} -p1
%if %{with docs}
# Provide example datasets for building docs.
tar xf %SOURCE1 --transform='s~^\(%{srcname}-data-%{data_commit}/\)~\1.xarray_tutorial_data/~'
%endif
%generate_buildrequires
%pyproject_buildrequires -r
%pyproject_buildrequires -x io
%build
%pyproject_wheel
%if %{with docs}
# generate html docs
pushd doc
PYTHONPATH=${PWD}/.. HOME=${PWD}/../%{srcname}-data-%{data_commit} make html
# remove the sphinx-build leftovers
rm -rf _build/html/.{doctrees,buildinfo}
popd
%endif
%install
%pyproject_install
%pyproject_save_files %{srcname}
%pyproject_save_files -l %{srcname}
%check
rm -rf xarray
@@ -115,23 +67,15 @@ rm -rf xarray
pytest_args=(
-n auto
-m "not network"
# https://github.com/pydata/xarray/issues/7513
-k 'not test_open_mfdataset_manyfiles'
# this test somehow crashes python interpreter entirely, was xfail upstream till recently
-k 'not test_save_mfdataset_compute_false_roundtrip'
)
%{pytest} -ra "${pytest_args[@]}" --pyargs xarray
%files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE licenses/DASK_LICENSE licenses/NUMPY_LICENSE licenses/PANDAS_LICENSE licenses/PYTHON_LICENSE licenses/SEABORN_LICENSE
%license licenses/*
%doc README.md
%if %{with docs}
%files -n python-%{srcname}-doc
%doc doc/_build/html
%license LICENSE licenses/DASK_LICENSE licenses/NUMPY_LICENSE licenses/PANDAS_LICENSE licenses/PYTHON_LICENSE licenses/SEABORN_LICENSE
%endif
%changelog
%autochangelog

View File

@@ -1,2 +1 @@
SHA512 (xarray-2023.8.0.tar.gz) = 1d712e9fbf266906ac35c199eead77cec76ba5b4b4462140bef2fffd227a52d2cba9670a042cb669b0567320e9308bf81fe4e84c1cfcff234ad2332d72e895a3
SHA512 (xarray-data-7d8290e0be9d2a8f4b4381641f20a97db6eaea3d.tar.gz) = 3734ad5649b9ba23e8fe52ac1fc34694dcb3c761a1817e520726a83d31e725e2448aa0109ad7ad385572ae7d6a285bf1407d104f87227127a6a51d73b797a952
SHA512 (xarray-2025.1.1.tar.gz) = a0cde2c8e38887878bcde25fd3ea6ee436b522ca73f52359d2c8ac1993447472d7cd5e5d4b11016ec48d1b86dba08e9207caf00b2b43ab896c777395e51f7943