Skip to content

expose setup_registry #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This page contains a auto-generated summary of ``pint-xarray``'s API.
:toctree: generated/

pint_xarray.unit_registry
pint_xarray.setup_registry

Dataset
-------
Expand Down
2 changes: 2 additions & 0 deletions docs/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ What's new
By `Justus Magin <https://github.com/keewis>`_.
- implement :py:meth:`Dataset.pint.interpolate_na` and :py:meth:`DataArray.pint.interpolate_na` (:pull:`82`).
By `Justus Magin <https://github.com/keewis>`_.
- expose :py:func:`pint_xarray.accessors.setup_registry` as public API (:pull:`89`)
By `Justus Magin <https://github.com/keewis>`_.

v0.1 (October 26 2020)
----------------------
Expand Down
14 changes: 10 additions & 4 deletions pint_xarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

import pint

from . import testing # noqa: F401
from . import formatting
from .accessors import PintDataArrayAccessor, PintDatasetAccessor # noqa: F401
from .accessors import default_registry as unit_registry # noqa: F401
from . import accessors, formatting, testing # noqa: F401
from .accessors import default_registry as unit_registry
from .accessors import setup_registry

try:
__version__ = version("pint-xarray")
Expand All @@ -19,3 +18,10 @@


pint.Quantity._repr_inline_ = formatting.inline_repr


__all__ = [
"testing",
"unit_registry",
"setup_registry",
]
6 changes: 4 additions & 2 deletions pint_xarray/accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,8 @@ def interpolate_na(
):
"""unit-aware version of interpolate_na

Like :py:meth:`DataArray.interpolate_na` but without stripping the units on data or coordinates.
Like :py:meth:`xarray.DataArray.interpolate_na` but without stripping the units
on data or coordinates.

.. note::
``max_gap`` is not supported, yet, and will be passed through to
Expand Down Expand Up @@ -1794,7 +1795,8 @@ def interpolate_na(
):
"""unit-aware version of interpolate_na

Like :py:meth:`Dataset.interpolate_na` but without stripping the units on data or coordinates.
Like :py:meth:`xarray.Dataset.interpolate_na` but without stripping the units on
data or coordinates.

.. note::
``max_gap`` is not supported, yet, and will be passed through to
Expand Down