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 4645be08b83..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<0.21 + - pint>=0.22 - pip - pseudonetcdf - pydap diff --git a/ci/requirements/environment-py311.yml b/ci/requirements/environment-py311.yml index 0b9817daef3..8d1107142d9 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>=0.22 - pip - pooch - pre-commit diff --git a/ci/requirements/environment-windows-py311.yml b/ci/requirements/environment-windows-py311.yml index 8c36c5a9fd4..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<0.21 + - pint>=0.22 - pip - pre-commit - pseudonetcdf diff --git a/ci/requirements/environment-windows.yml b/ci/requirements/environment-windows.yml index efa9ccb5a9a..b4c760b25c4 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>=0.22 - pip - pre-commit - pseudonetcdf diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index 6e93ab7a946..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 diff --git a/ci/requirements/min-all-deps.yml b/ci/requirements/min-all-deps.yml index 8400270ce1b..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.19 + - pint=0.22 - pip - pseudonetcdf=3.2 - pydap=3.3 diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 430da3e4c4e..382953cde10 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 ~~~~~~~~~~~~ diff --git a/xarray/tests/test_units.py b/xarray/tests/test_units.py index 14a7a10f734..be13e75be4c 100644 --- a/xarray/tests/test_units.py +++ b/xarray/tests/test_units.py @@ -2,12 +2,10 @@ import functools import operator -import sys 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 @@ -1513,10 +1511,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", ( @@ -1539,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 ) @@ -2348,10 +2335,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", ( @@ -2404,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 ) @@ -2429,10 +2405,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 +4057,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", ( @@ -4110,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" @@ -5647,10 +5608,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