Skip to content

Commit 56941d8

Browse files
committed
Expose top-level xarray.indexes in __init__
Also expose CoordinateTransformIndex Closes #10424
1 parent 4d0300e commit 56941d8

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

doc/whats-new.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ v2025.07.0 (unreleased)
1212

1313
New Features
1414
~~~~~~~~~~~~
15+
- Expose :py:class:`~xarray.indexes.RangeIndex`, and :py:class:`~xarray.indexes.CoordinateTransformIndex` as public api
16+
under the ``xarray.indexes`` namespace. By `Deepak Cherian <https://github.com/dcherian>`_.
1517

1618

1719
Breaking changes

xarray/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from importlib.metadata import version as _version
22

3-
from xarray import coders, groupers, testing, tutorial, ufuncs
3+
from xarray import coders, groupers, indexes, testing, tutorial, ufuncs
44
from xarray.backends.api import (
55
load_dataarray,
66
load_dataset,
@@ -70,6 +70,7 @@
7070
# Sub-packages
7171
"coders",
7272
"groupers",
73+
"indexes",
7374
"testing",
7475
"tutorial",
7576
"ufuncs",

xarray/indexes/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33
44
"""
55

6+
from xarray.core.coordinate_transform import CoordinateTransform
67
from xarray.core.indexes import (
8+
CoordinateTransformIndex,
79
Index,
810
PandasIndex,
911
PandasMultiIndex,
1012
)
1113
from xarray.indexes.range_index import RangeIndex
1214

13-
__all__ = ["Index", "PandasIndex", "PandasMultiIndex", "RangeIndex"]
15+
__all__ = [
16+
"CoordinateTransformIndex",
17+
"Index",
18+
"PandasIndex",
19+
"PandasMultiIndex",
20+
"RangeIndex",
21+
]

0 commit comments

Comments
 (0)