Skip to content

Commit

Permalink
Pint support for DataArray (#3643)
Browse files Browse the repository at this point in the history
* remove xfail marks from median and cumprod

* remove all xfails not related to indexes or external packages

* switch away from using assert_equal_with_units

* use assert_allclose in a few cases instead

* don't use a kwarg for searchsorted

normally, this should work, but the documentation mismatches the
implementation of searchsorted and names the keys as `keys` instead of `v`

* move the tests for item into their own test function

* move the searchsorted tests into their own test function

* remove a wrapping pytest.param

* treat objects implementing __array_function__ the same as ndarray

* mark numpy.median as xfailing

* remove the xfail marks for the all and any tests

* use assert_units_equal to check the resulting units

* don't attempt to use interpolate_na with int dtype arrays

* update the xfail reason for DataArray.interpolate_na

* xfail the compatible units bivariate_ufunc test and don't use 0

* combine and expand the reindex and interp tests

* combine and expand the reindex_like and interp_like tests

* xfail the quantile tests if pint is not recent enough

* xfail the rolling tests

* don't xfail combine_first

it currently does not test indexing, so probably will need a new test
for that.

* use numpy's assert_allclose

* don't add dimension coordinates if they're not necessary

* add the PR to the list of related PRs

* move the whats-new.rst entry to 0.16.0

* check for __array_ufunc__ to decide if the type is supported

* xfail the bivariate ufunc tests

* remove the check for __array_ufunc__

* skip the DataArray.identical tests

* use pytest.param
  • Loading branch information
keewis authored Apr 29, 2020
1 parent 8834afa commit 3820fb7
Show file tree
Hide file tree
Showing 2 changed files with 289 additions and 234 deletions.
3 changes: 3 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ New Features
- Implement :py:meth:`DataArray.idxmax`, :py:meth:`DataArray.idxmin`,
:py:meth:`Dataset.idxmax`, :py:meth:`Dataset.idxmin`. (:issue:`60`, :pull:`3871`)
By `Todd Jennings <https://github.com/toddrjen>`_
- More support for unit aware arrays with pint (:pull:`3643`)
By `Justus Magin <https://github.com/keewis>`_.

- Allow plotting of boolean arrays. (:pull:`3766`)
By `Marek Jacob <https://github.com/MeraX>`_
- A ``days_in_month`` accessor for :py:class:`xarray.CFTimeIndex`, analogous to
Expand Down
Loading

0 comments on commit 3820fb7

Please sign in to comment.