From 84af7a391bb730e166c245ecdd0fc22a7a685cf3 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Sat, 11 Nov 2023 20:58:36 -0700 Subject: [PATCH 1/8] unpin pint --- ci/requirements/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index 6e93ab7a946..b892e1b50b5 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -29,7 +29,7 @@ dependencies: - opt_einsum - packaging - pandas - - pint<0.21 + - pint - pip - pooch - pre-commit From 5c0fe70f3a1da8daddb5312577b80534a6c42d69 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Sat, 11 Nov 2023 21:09:11 -0700 Subject: [PATCH 2/8] More unpins --- ci/requirements/all-but-dask.yml | 2 +- ci/requirements/environment-py311.yml | 2 +- ci/requirements/environment-windows-py311.yml | 2 +- ci/requirements/environment-windows.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/requirements/all-but-dask.yml b/ci/requirements/all-but-dask.yml index 4645be08b83..84410be8836 100644 --- a/ci/requirements/all-but-dask.yml +++ b/ci/requirements/all-but-dask.yml @@ -26,7 +26,7 @@ dependencies: - numpy - packaging - pandas - - pint<0.21 + - pint - pip - pseudonetcdf - pydap diff --git a/ci/requirements/environment-py311.yml b/ci/requirements/environment-py311.yml index 0b9817daef3..7f178043489 100644 --- a/ci/requirements/environment-py311.yml +++ b/ci/requirements/environment-py311.yml @@ -28,7 +28,7 @@ dependencies: - numpy - packaging - pandas - - pint<0.21 + - pint - pip - pooch - pre-commit diff --git a/ci/requirements/environment-windows-py311.yml b/ci/requirements/environment-windows-py311.yml index 8c36c5a9fd4..97cfb89ff6f 100644 --- a/ci/requirements/environment-windows-py311.yml +++ b/ci/requirements/environment-windows-py311.yml @@ -25,7 +25,7 @@ dependencies: - numpy - packaging - pandas - - pint<0.21 + - pint - pip - pre-commit - pseudonetcdf diff --git a/ci/requirements/environment-windows.yml b/ci/requirements/environment-windows.yml index efa9ccb5a9a..64b6e08e7bd 100644 --- a/ci/requirements/environment-windows.yml +++ b/ci/requirements/environment-windows.yml @@ -25,7 +25,7 @@ dependencies: - numpy - packaging - pandas - - pint<0.21 + - pint - pip - pre-commit - pseudonetcdf From 5528362e18952e98144fd827c32dda9d6b2cca02 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Sat, 11 Nov 2023 21:38:06 -0700 Subject: [PATCH 3/8] Try>=0.21 --- ci/requirements/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index b892e1b50b5..4b8d7769a18 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -29,7 +29,7 @@ dependencies: - opt_einsum - packaging - pandas - - pint + - pint>=0.21 - pip - pooch - pre-commit From 42fb067991edbd31d8ae0936f1b26787f651fbba Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Sun, 12 Nov 2023 14:32:38 -0700 Subject: [PATCH 4/8] Bump pint to >=0.22 --- .binder/environment.yml | 4 ++-- ci/requirements/all-but-dask.yml | 2 +- ci/requirements/environment-py311.yml | 2 +- ci/requirements/environment-windows-py311.yml | 2 +- ci/requirements/environment-windows.yml | 2 +- ci/requirements/environment.yml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.binder/environment.yml b/.binder/environment.yml index 99a7d9f2494..fa4e14c41c2 100644 --- a/.binder/environment.yml +++ b/.binder/environment.yml @@ -2,7 +2,7 @@ name: xarray-examples channels: - conda-forge dependencies: - - python=3.9 + - python=3.10 - boto3 - bottleneck - cartopy @@ -25,7 +25,7 @@ dependencies: - numpy - packaging - pandas - - pint + - pint>=0.22 - pip - pooch - pydap diff --git a/ci/requirements/all-but-dask.yml b/ci/requirements/all-but-dask.yml index 84410be8836..0de81ea768c 100644 --- a/ci/requirements/all-but-dask.yml +++ b/ci/requirements/all-but-dask.yml @@ -26,7 +26,7 @@ dependencies: - numpy - packaging - pandas - - pint + - pint>=0.22 - pip - pseudonetcdf - pydap diff --git a/ci/requirements/environment-py311.yml b/ci/requirements/environment-py311.yml index 7f178043489..8d1107142d9 100644 --- a/ci/requirements/environment-py311.yml +++ b/ci/requirements/environment-py311.yml @@ -28,7 +28,7 @@ dependencies: - numpy - packaging - pandas - - pint + - pint>=0.22 - pip - pooch - pre-commit diff --git a/ci/requirements/environment-windows-py311.yml b/ci/requirements/environment-windows-py311.yml index 97cfb89ff6f..f590acb77a4 100644 --- a/ci/requirements/environment-windows-py311.yml +++ b/ci/requirements/environment-windows-py311.yml @@ -25,7 +25,7 @@ dependencies: - numpy - packaging - pandas - - pint + - pint>=0.22 - pip - pre-commit - pseudonetcdf diff --git a/ci/requirements/environment-windows.yml b/ci/requirements/environment-windows.yml index 64b6e08e7bd..b4c760b25c4 100644 --- a/ci/requirements/environment-windows.yml +++ b/ci/requirements/environment-windows.yml @@ -25,7 +25,7 @@ dependencies: - numpy - packaging - pandas - - pint + - pint>=0.22 - pip - pre-commit - pseudonetcdf diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index 4b8d7769a18..7009932f7eb 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -29,7 +29,7 @@ dependencies: - opt_einsum - packaging - pandas - - pint>=0.21 + - pint>=0.22 - pip - pooch - pre-commit From 742637ac0a2372ea642f31b2b75ee36533bad127 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Sun, 12 Nov 2023 14:34:43 -0700 Subject: [PATCH 5/8] Undo windows test skips --- xarray/tests/test_units.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/xarray/tests/test_units.py b/xarray/tests/test_units.py index 14a7a10f734..01b6feb4f33 100644 --- a/xarray/tests/test_units.py +++ b/xarray/tests/test_units.py @@ -2,7 +2,6 @@ import functools import operator -import sys import numpy as np import pandas as pd @@ -1513,10 +1512,6 @@ def test_dot_dataarray(dtype): class TestVariable: - @pytest.mark.skipif( - (sys.version_info >= (3, 11)) and sys.platform.startswith("win"), - reason="fails for some reason on win and 3.11, GH7971", - ) @pytest.mark.parametrize( "func", ( @@ -2348,10 +2343,6 @@ def test_repr(self, func, variant, dtype): # warnings or errors, but does not check the result func(data_array) - @pytest.mark.skipif( - (sys.version_info >= (3, 11)) and sys.platform.startswith("win"), - reason="fails for some reason on win and 3.11, GH7971", - ) @pytest.mark.parametrize( "func", ( @@ -2429,10 +2420,6 @@ def test_aggregation(self, func, dtype): assert_units_equal(expected, actual) assert_allclose(expected, actual) - @pytest.mark.skipif( - (sys.version_info >= (3, 11)) and sys.platform.startswith("win"), - reason="fails for some reason on win and 3.11, GH7971", - ) @pytest.mark.parametrize( "func", ( @@ -4085,10 +4072,6 @@ def test_repr(self, func, variant, dtype): # warnings or errors, but does not check the result func(ds) - @pytest.mark.skipif( - (sys.version_info >= (3, 11)) and sys.platform.startswith("win"), - reason="fails for some reason on win and 3.11, GH7971", - ) @pytest.mark.parametrize( "func", ( @@ -5647,10 +5630,6 @@ def test_merge(self, variant, unit, error, dtype): @requires_dask class TestPintWrappingDask: - @pytest.mark.skipif( - version.parse(pint.__version__) <= version.parse("0.21"), - reason="pint didn't support dask properly before 0.21", - ) def test_duck_array_ops(self): import dask.array From 57c74de764eaf67a67b78b42f8230e24d7004fa3 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Sun, 12 Nov 2023 14:34:54 -0700 Subject: [PATCH 6/8] Remove nanprod skips --- xarray/tests/test_units.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/xarray/tests/test_units.py b/xarray/tests/test_units.py index 01b6feb4f33..be13e75be4c 100644 --- a/xarray/tests/test_units.py +++ b/xarray/tests/test_units.py @@ -6,7 +6,6 @@ import numpy as np import pandas as pd import pytest -from packaging import version import xarray as xr from xarray.core import dtypes, duck_array_ops @@ -1534,13 +1533,6 @@ class TestVariable: ids=repr, ) def test_aggregation(self, func, dtype): - if ( - func.name == "prod" - and dtype.kind == "f" - and version.parse(pint.__version__) < version.parse("0.19") - ): - pytest.xfail(reason="nanprod is not by older `pint` versions") - array = np.linspace(0, 1, 10).astype(dtype) * ( unit_registry.m if func.name != "cumprod" else unit_registry.dimensionless ) @@ -2395,13 +2387,6 @@ def test_repr(self, func, variant, dtype): ids=repr, ) def test_aggregation(self, func, dtype): - if ( - func.name == "prod" - and dtype.kind == "f" - and version.parse(pint.__version__) < version.parse("0.19") - ): - pytest.xfail(reason="nanprod is not by older `pint` versions") - array = np.arange(10).astype(dtype) * ( unit_registry.m if func.name != "cumprod" else unit_registry.dimensionless ) @@ -4093,13 +4078,6 @@ def test_repr(self, func, variant, dtype): ids=repr, ) def test_aggregation(self, func, dtype): - if ( - func.name == "prod" - and dtype.kind == "f" - and version.parse(pint.__version__) < version.parse("0.19") - ): - pytest.xfail(reason="nanprod is not by older `pint` versions") - unit_a, unit_b = ( (unit_registry.Pa, unit_registry.degK) if func.name != "cumprod" From fde3bcffffebb45890f927bf33011bb3ca7bcb0f Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Sun, 12 Nov 2023 14:56:22 -0700 Subject: [PATCH 7/8] Bump min-deps --- ci/requirements/min-all-deps.yml | 2 +- doc/whats-new.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/requirements/min-all-deps.yml b/ci/requirements/min-all-deps.yml index 8400270ce1b..06730f69cce 100644 --- a/ci/requirements/min-all-deps.yml +++ b/ci/requirements/min-all-deps.yml @@ -35,7 +35,7 @@ dependencies: - numpy=1.22 - packaging=21.3 - pandas=1.4 - - pint=0.19 + - pint>=0.22 - pip - pseudonetcdf=3.2 - pydap=3.3 diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 157282803cc..261f447e6f4 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -30,6 +30,7 @@ New Features Breaking changes ~~~~~~~~~~~~~~~~ +- Bump minimum tested pint version to ``>=0.22``. By `Deepak Cherian `_. Deprecations ~~~~~~~~~~~~ From ddaa6b4f5079a29087bbf1155086ff0b796b1044 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 12 Nov 2023 23:40:03 +0100 Subject: [PATCH 8/8] use exact pin --- ci/requirements/min-all-deps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements/min-all-deps.yml b/ci/requirements/min-all-deps.yml index 06730f69cce..854289ffab4 100644 --- a/ci/requirements/min-all-deps.yml +++ b/ci/requirements/min-all-deps.yml @@ -35,7 +35,7 @@ dependencies: - numpy=1.22 - packaging=21.3 - pandas=1.4 - - pint>=0.22 + - pint=0.22 - pip - pseudonetcdf=3.2 - pydap=3.3