Skip to content

Commit 9f97c43

Browse files
authored
Pint support for top-level functions (#3611)
* get the align tests to pass * add pint to the upstream-dev ci job * special case for booleans * silence the pint behaviour change warning * preprocess the unit mapping parameter to convert_units * use assert_allclose and assert_identical instead * clean up a few tests * remove some xfails * use the unit registry's quantity class * explain the catch_warnings block * don't use the function wrapper class if we don't need arguments * whats-new.rst * require the new pint version * use functools.partial instead of function * remove the convert_from parameter of array_attach_units * make sure every top-level function test uses assert_units_equal * hide the traceback of the unit comparison function * considerably simplify the merge_dataarray test * simplify the merge_dataset test
1 parent f4ebbfe commit 9f97c43

File tree

3 files changed

+203
-157
lines changed

3 files changed

+203
-157
lines changed

ci/requirements/py36-min-nep18.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
- msgpack-python=0.6 # remove once distributed is bumped. distributed GH3491
1212
- numpy=1.17
1313
- pandas=0.25
14-
- pint=0.9 # Actually not enough as it doesn't implement __array_function__yet!
14+
- pint=0.11
1515
- pip
1616
- pytest
1717
- pytest-cov

doc/whats-new.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ New Features
3232
- Support new h5netcdf backend keyword `phony_dims` (available from h5netcdf
3333
v0.8.0 for :py:class:`~xarray.backends.H5NetCDFStore`.
3434
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
35-
- implement pint support. (:issue:`3594`, :pull:`3706`)
35+
- Support unit aware arrays with pint. (:issue:`3594`, :pull:`3706`, :pull:`3611`)
3636
By `Justus Magin <https://github.com/keewis>`_.
3737
- :py:meth:`Dataset.groupby` and :py:meth:`DataArray.groupby` now raise a
3838
`TypeError` on multiple string arguments. Receiving multiple string arguments

0 commit comments

Comments
 (0)