Skip to content

Commit 10e87f2

Browse files
authored
remove the explicit checks for Quantity.__array_function__ and NEP18 (#33)
* remove the checks for __array_function__ * fix the required versions
1 parent 8e173c9 commit 10e87f2

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

pint_xarray/accessors.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,9 @@
55
from pint.quantity import Quantity
66
from pint.unit import Unit
77
from xarray import DataArray, register_dataarray_accessor, register_dataset_accessor
8-
from xarray.core.npcompat import IS_NEP18_ACTIVE
98

109
from . import conversion
1110

12-
if not hasattr(Quantity, "__array_function__"):
13-
raise ImportError(
14-
"Imported version of pint does not implement " "__array_function__"
15-
)
16-
17-
if not IS_NEP18_ACTIVE:
18-
raise ImportError("NUMPY_EXPERIMENTAL_ARRAY_FUNCTION is not enabled")
19-
20-
2111
# TODO could/should we overwrite xr.open_dataset and xr.open_mfdataset to make
2212
# them apply units upon loading???
2313
# TODO could even override the decode_cf kwarg?

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ url = https://github.com/TomNicholas/pint-xarray
99
packages = find:
1010
python_requires = >=3.6
1111
install_requires =
12-
numpy >= 1.17.1
13-
xarray >= 0.15.1
12+
numpy >= 1.17
13+
xarray >= 0.16
1414
pint >= 0.13
1515
importlib-metadata; python_version < "3.8"
1616

0 commit comments

Comments
 (0)