Skip to content

Add public typing.py module #10215

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 8 commits into from
May 6, 2025
3 changes: 3 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ New Features

- Added `scipy-stubs <https://github.com/scipy/scipy-stubs>`_ to the ``xarray[types]`` dependencies.
By `Joren Hammudoglu <https://github.com/jorenham>`_.
- Added a :mod:`xarray.typing` module to expose selected public types for use in downstream libraries and static type checking.
(:issue:`10179`, :pull:`10215`).
By `Michele Guerreri <https://github.com/micguerr-bopen>`_.
- Improved compatibility with OPeNDAP DAP4 data model for backend engine ``pydap``. This
includes ``datatree`` support, and removing slashes from dimension names. By
`Miguel Jimenez-Urias <https://github.com/Mikejmnez>`_.
Expand Down
23 changes: 23 additions & 0 deletions xarray/typing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Public typing utilities for use by external libraries.
"""

from xarray.computation.rolling import (
DataArrayCoarsen,
DataArrayRolling,
DatasetRolling,
)
from xarray.computation.weighted import DataArrayWeighted, DatasetWeighted, Weighted
from xarray.core.groupby import DataArrayGroupBy
from xarray.core.resample import DataArrayResample

__all__ = [
"DataArrayCoarsen",
"DataArrayGroupBy",
"DataArrayResample",
"DataArrayRolling",
"DataArrayWeighted",
"DatasetRolling",
"DatasetWeighted",
"Weighted",
]
Loading