Skip to content

Commit

Permalink
warn about .quantify setting the units of dimension coordinates as …
Browse files Browse the repository at this point in the history
…attributes (#126)

* make the note about dim coords in the docstring of quantify a warning

* update whats-new.rst [skip-ci]

* fill in the issue / PR numbers
  • Loading branch information
keewis committed Jul 23, 2021
1 parent 0732ea9 commit 451b639
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ What's new
- allow special "no unit" values in :py:meth:`Dataset.pint.quantify` and
:py:meth:`DataArray.pint.quantify` (:pull:`125`)
By `Justus Magin <https://github.com/keewis>`_.
- convert the note about dimension coordinates saving their units in the attributes a
warning (:issue:`124`, :pull:`126`)
By `Justus Magin <https://github.com/keewis>`_.

0.2 (May 10 2021)
-----------------
Expand Down
4 changes: 4 additions & 0 deletions pint_xarray/accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def quantify(self, units=_default, unit_registry=None, **unit_kwargs):
the data into memory. To avoid that, consider converting
to ``dask`` first (e.g. using ``chunk``).
.. warning::
As units in dimension coordinates are not supported until
``xarray`` changes the way it implements indexes, these
units will be set as attributes.
Expand Down Expand Up @@ -915,6 +917,8 @@ def quantify(self, units=_default, unit_registry=None, **unit_kwargs):
the data into memory. To avoid that, consider converting
to ``dask`` first (e.g. using ``chunk``).
.. warning::
As units in dimension coordinates are not supported until
``xarray`` changes the way it implements indexes, these
units will be set as attributes.
Expand Down

0 comments on commit 451b639

Please sign in to comment.