Skip to content

Commit

Permalink
Pint support for top-level functions (#3611)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
keewis authored Mar 9, 2020
1 parent f4ebbfe commit 9f97c43
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 157 deletions.
2 changes: 1 addition & 1 deletion ci/requirements/py36-min-nep18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- msgpack-python=0.6 # remove once distributed is bumped. distributed GH3491
- numpy=1.17
- pandas=0.25
- pint=0.9 # Actually not enough as it doesn't implement __array_function__yet!
- pint=0.11
- pip
- pytest
- pytest-cov
Expand Down
2 changes: 1 addition & 1 deletion doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ New Features
- Support new h5netcdf backend keyword `phony_dims` (available from h5netcdf
v0.8.0 for :py:class:`~xarray.backends.H5NetCDFStore`.
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- implement pint support. (:issue:`3594`, :pull:`3706`)
- Support unit aware arrays with pint. (:issue:`3594`, :pull:`3706`, :pull:`3611`)
By `Justus Magin <https://github.com/keewis>`_.
- :py:meth:`Dataset.groupby` and :py:meth:`DataArray.groupby` now raise a
`TypeError` on multiple string arguments. Receiving multiple string arguments
Expand Down
Loading

0 comments on commit 9f97c43

Please sign in to comment.