Skip to content

Commit d998eac

Browse files
micguerr-bopenpre-commit-ci[bot]dcherian
authored
Add public typing.py module (#10215)
* created plain new module * Drafted a first version of the typing.py module * Removed TYPPE_CHECKING. Also removed DataArray, Dataset * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added typing module as new feature for next version releas --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Deepak Cherian <[email protected]>
1 parent fc0e9b8 commit d998eac

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

doc/whats-new.rst

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ New Features
3131

3232
- Added `scipy-stubs <https://github.com/scipy/scipy-stubs>`_ to the ``xarray[types]`` dependencies.
3333
By `Joren Hammudoglu <https://github.com/jorenham>`_.
34+
- Added a :mod:`xarray.typing` module to expose selected public types for use in downstream libraries and static type checking.
35+
(:issue:`10179`, :pull:`10215`).
36+
By `Michele Guerreri <https://github.com/micguerr-bopen>`_.
3437
- Improved compatibility with OPeNDAP DAP4 data model for backend engine ``pydap``. This
3538
includes ``datatree`` support, and removing slashes from dimension names. By
3639
`Miguel Jimenez-Urias <https://github.com/Mikejmnez>`_.

xarray/typing.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
Public typing utilities for use by external libraries.
3+
"""
4+
5+
from xarray.computation.rolling import (
6+
DataArrayCoarsen,
7+
DataArrayRolling,
8+
DatasetRolling,
9+
)
10+
from xarray.computation.weighted import DataArrayWeighted, DatasetWeighted, Weighted
11+
from xarray.core.groupby import DataArrayGroupBy
12+
from xarray.core.resample import DataArrayResample
13+
14+
__all__ = [
15+
"DataArrayCoarsen",
16+
"DataArrayGroupBy",
17+
"DataArrayResample",
18+
"DataArrayRolling",
19+
"DataArrayWeighted",
20+
"DatasetRolling",
21+
"DatasetWeighted",
22+
"Weighted",
23+
]

0 commit comments

Comments
 (0)