Skip to content

Commit d93a4d4

Browse files
authored
expose setup_registry (#89)
* add a __all__ * expose setup_registry * fix some links * update whats-new.rst
1 parent 46e9e90 commit d93a4d4

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

docs/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This page contains a auto-generated summary of ``pint-xarray``'s API.
66
:toctree: generated/
77

88
pint_xarray.unit_registry
9+
pint_xarray.setup_registry
910

1011
Dataset
1112
-------

docs/whats-new.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ What's new
4242
By `Justus Magin <https://github.com/keewis>`_.
4343
- implement :py:meth:`Dataset.pint.interpolate_na` and :py:meth:`DataArray.pint.interpolate_na` (:pull:`82`).
4444
By `Justus Magin <https://github.com/keewis>`_.
45+
- expose :py:func:`pint_xarray.accessors.setup_registry` as public API (:pull:`89`)
46+
By `Justus Magin <https://github.com/keewis>`_.
4547

4648
v0.1 (October 26 2020)
4749
----------------------

pint_xarray/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
import pint
77

8-
from . import testing # noqa: F401
9-
from . import formatting
10-
from .accessors import PintDataArrayAccessor, PintDatasetAccessor # noqa: F401
11-
from .accessors import default_registry as unit_registry # noqa: F401
8+
from . import accessors, formatting, testing # noqa: F401
9+
from .accessors import default_registry as unit_registry
10+
from .accessors import setup_registry
1211

1312
try:
1413
__version__ = version("pint-xarray")
@@ -19,3 +18,10 @@
1918

2019

2120
pint.Quantity._repr_inline_ = formatting.inline_repr
21+
22+
23+
__all__ = [
24+
"testing",
25+
"unit_registry",
26+
"setup_registry",
27+
]

pint_xarray/accessors.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,8 @@ def interpolate_na(
10331033
):
10341034
"""unit-aware version of interpolate_na
10351035
1036-
Like :py:meth:`DataArray.interpolate_na` but without stripping the units on data or coordinates.
1036+
Like :py:meth:`xarray.DataArray.interpolate_na` but without stripping the units
1037+
on data or coordinates.
10371038
10381039
.. note::
10391040
``max_gap`` is not supported, yet, and will be passed through to
@@ -1794,7 +1795,8 @@ def interpolate_na(
17941795
):
17951796
"""unit-aware version of interpolate_na
17961797
1797-
Like :py:meth:`Dataset.interpolate_na` but without stripping the units on data or coordinates.
1798+
Like :py:meth:`xarray.Dataset.interpolate_na` but without stripping the units on
1799+
data or coordinates.
17981800
17991801
.. note::
18001802
``max_gap`` is not supported, yet, and will be passed through to

0 commit comments

Comments
 (0)