[Git][debian-gis-team/pint-xarray][upstream] New upstream version 0.5.1
Antonio Valentino (@antonio.valentino)
gitlab at salsa.debian.org
Wed Aug 13 06:38:51 BST 2025
Antonio Valentino pushed to branch upstream at Debian GIS Project / pint-xarray
Commits:
0dd7e25b by Antonio Valentino at 2025-08-13T05:29:41+00:00
New upstream version 0.5.1
- - - - -
8 changed files:
- .github/workflows/ci-additional.yml
- .github/workflows/ci.yml
- .pre-commit-config.yaml
- ci/requirements.txt
- docs/whats-new.rst
- pint_xarray/index.py
- pint_xarray/tests/test_index.py
- pyproject.toml
Changes:
=====================================
.github/workflows/ci-additional.yml
=====================================
@@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: ["3.12"]
+ python-version: ["3.13"]
env:
FORCE_COLOR: 3
=====================================
.github/workflows/ci.yml
=====================================
@@ -50,7 +50,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: ["3.10", "3.11", "3.12"]
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
=====================================
.pre-commit-config.yaml
=====================================
@@ -10,7 +10,7 @@ repos:
- id: end-of-file-fixer
- id: check-docstring-first
- repo: https://github.com/rbubley/mirrors-prettier
- rev: v3.5.3
+ rev: v3.6.2
hooks:
- id: prettier
args: ["--cache-location=.prettier_cache/cache"]
@@ -31,13 +31,13 @@ repos:
hooks:
- id: black-jupyter
- repo: https://github.com/keewis/blackdoc
- rev: v0.3.9
+ rev: v0.4.1
hooks:
- id: blackdoc
additional_dependencies: ["black==25.1.0"]
- id: blackdoc-autoupdate-black
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.11.13
+ rev: v0.12.7
hooks:
- id: ruff
args: [--fix]
=====================================
ci/requirements.txt
=====================================
@@ -1,5 +1,5 @@
pint!=0.24.0
-numpy<2
+numpy
scipy
dask[array]
bottleneck
=====================================
docs/whats-new.rst
=====================================
@@ -2,6 +2,13 @@
What's new
==========
+0.5.1 (10 Aug 2025)
+-------------------
+- Pass ``sel`` options to the wrapped array (:pull:`304`, :issue:`303`)
+ By `Bhavin Patel <https://github.com/bpatel2107>`_.
+- Support python 3.13 (:pull:`310`)
+ By `Justus Magin <https://github.com/keewis>`_.
+
0.5 (09 Jun 2025)
------------------
- drop support for python 3.9 (:pull:`266`)
=====================================
pint_xarray/index.py
=====================================
@@ -52,11 +52,11 @@ class PintIndex(Index):
def unstack(self):
raise NotImplementedError()
- def sel(self, labels):
+ def sel(self, labels, **options):
converted_labels = conversion.convert_indexer_units(labels, self.units)
stripped_labels = conversion.strip_indexer_units(converted_labels)
- return self.index.sel(stripped_labels)
+ return self.index.sel(stripped_labels, **options)
def isel(self, indexers):
subset = self.index.isel(indexers)
=====================================
pint_xarray/tests/test_index.py
=====================================
@@ -104,6 +104,42 @@ def test_sel(labels, expected):
)
+ at pytest.mark.parametrize(
+ ["labels", "expected"],
+ (
+ (
+ {"x": ureg.Quantity(1.1, "m")},
+ IndexSelResult(dim_indexers={"x": np.array(0)}),
+ ),
+ (
+ {"x": ureg.Quantity(3100, "mm")},
+ IndexSelResult(dim_indexers={"x": np.array(2)}),
+ ),
+ (
+ {"x": ureg.Quantity(0.0021, "km")},
+ IndexSelResult(dim_indexers={"x": np.array(1)}),
+ ),
+ (
+ {"x": ureg.Quantity([0.0021, 0.0041], "km")},
+ IndexSelResult(dim_indexers={"x": np.array([1, 3])}),
+ ),
+ ),
+)
+def test_sel_nearest(labels, expected):
+ index = PintIndex(
+ index=PandasIndex(pd.Index([1, 2, 3, 4]), dim="x"), units={"x": ureg.Unit("m")}
+ )
+
+ actual = index.sel(labels, method="nearest")
+
+ assert isinstance(actual, IndexSelResult)
+ assert actual.dim_indexers.keys() == expected.dim_indexers.keys()
+ assert all(
+ indexer_equal(actual.dim_indexers[k], expected.dim_indexers[k])
+ for k in expected.dim_indexers.keys()
+ )
+
+
@pytest.mark.parametrize(
"indexers",
({"y": 0}, {"y": [1, 2]}, {"y": slice(0, None, 2)}, {"y": xr.Variable("y", [1])}),
=====================================
pyproject.toml
=====================================
@@ -16,6 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
+ "Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
]
requires-python = ">=3.10"
View it on GitLab: https://salsa.debian.org/debian-gis-team/pint-xarray/-/commit/0dd7e25b4025678343b9f3c86531829c63c6c3b7
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/pint-xarray/-/commit/0dd7e25b4025678343b9f3c86531829c63c6c3b7
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250813/9fdf2bba/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list