Skip to content

Commit 451b639

Browse files
authored
warn about .quantify setting the units of dimension coordinates as 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
1 parent 0732ea9 commit 451b639

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

docs/whats-new.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ What's new
88
- allow special "no unit" values in :py:meth:`Dataset.pint.quantify` and
99
:py:meth:`DataArray.pint.quantify` (:pull:`125`)
1010
By `Justus Magin <https://github.com/keewis>`_.
11+
- convert the note about dimension coordinates saving their units in the attributes a
12+
warning (:issue:`124`, :pull:`126`)
13+
By `Justus Magin <https://github.com/keewis>`_.
1114

1215
0.2 (May 10 2021)
1316
-----------------

pint_xarray/accessors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ def quantify(self, units=_default, unit_registry=None, **unit_kwargs):
260260
the data into memory. To avoid that, consider converting
261261
to ``dask`` first (e.g. using ``chunk``).
262262
263+
.. warning::
264+
263265
As units in dimension coordinates are not supported until
264266
``xarray`` changes the way it implements indexes, these
265267
units will be set as attributes.
@@ -915,6 +917,8 @@ def quantify(self, units=_default, unit_registry=None, **unit_kwargs):
915917
the data into memory. To avoid that, consider converting
916918
to ``dask`` first (e.g. using ``chunk``).
917919
920+
.. warning::
921+
918922
As units in dimension coordinates are not supported until
919923
``xarray`` changes the way it implements indexes, these
920924
units will be set as attributes.

0 commit comments

Comments
 (0)