Skip to content

Commit 0bda19a

Browse files
committed
Update Custom Indexes section in api.rst
1 parent dac661d commit 0bda19a

File tree

4 files changed

+43
-29
lines changed

4 files changed

+43
-29
lines changed

doc/api-hidden.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -515,22 +515,6 @@
515515
CFTimeIndex.values
516516
CFTimeIndex.year
517517

518-
Index.from_variables
519-
Index.concat
520-
Index.stack
521-
Index.unstack
522-
Index.create_variables
523-
Index.should_add_coord_to_array
524-
Index.to_pandas_index
525-
Index.isel
526-
Index.sel
527-
Index.join
528-
Index.reindex_like
529-
Index.equals
530-
Index.roll
531-
Index.rename
532-
Index.copy
533-
534518
indexes.RangeIndex.start
535519
indexes.RangeIndex.stop
536520
indexes.RangeIndex.step

doc/api.rst

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,12 +1571,22 @@ Custom Indexes
15711571
==============
15721572
.. currentmodule:: xarray
15731573

1574+
Default, pandas-backed indexes built-in to Xarray:
1575+
1576+
.. autosummary::
1577+
:toctree: generated/
1578+
1579+
indexes.PandasIndex
1580+
indexes.PandasMultiIndex
1581+
1582+
1583+
More complex indexes built-in to Xarray:
1584+
15741585
.. autosummary::
15751586
:toctree: generated/
15761587

15771588
CFTimeIndex
15781589
indexes.RangeIndex
1579-
indexes.CoordinateTransformIndex
15801590
indexes.NDPointIndex
15811591

15821592
Creating custom indexes
@@ -1590,12 +1600,38 @@ Creating custom indexes
15901600
indexes.RangeIndex.arange
15911601
indexes.RangeIndex.linspace
15921602

1603+
The Index base class for building custom indexes:
1604+
1605+
.. autosummary::
1606+
:toctree: generated/
1607+
1608+
Index.from_variables
1609+
Index.concat
1610+
Index.stack
1611+
Index.unstack
1612+
Index.create_variables
1613+
Index.should_add_coord_to_array
1614+
Index.to_pandas_index
1615+
Index.isel
1616+
Index.sel
1617+
Index.join
1618+
Index.reindex_like
1619+
Index.equals
1620+
Index.roll
1621+
Index.rename
1622+
Index.copy
1623+
15931624
Building custom indexes
15941625
-----------------------
1626+
1627+
These classes are building blocks for more complex Indexes:
1628+
15951629
.. autosummary::
15961630
:toctree: generated/
15971631

15981632
indexes.CoordinateTransform
1633+
indexes.CoordinateTransformIndex
1634+
indexes.NDPointIndex
15991635

16001636
Tutorial
16011637
========
@@ -1702,14 +1738,6 @@ Advanced API
17021738
.. Missing:
17031739
.. ``DataTree.set_close``
17041740
1705-
Default, pandas-backed indexes built-in Xarray:
1706-
1707-
.. autosummary::
1708-
:toctree: generated/
1709-
1710-
indexes.PandasIndex
1711-
indexes.PandasMultiIndex
1712-
17131741
These backends provide a low-level interface for lazily loading data from
17141742
external file-formats or protocols, and can be manually invoked to create
17151743
arguments for the ``load_store`` and ``dump_to_store`` Dataset methods:

xarray/core/coordinate_transform.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
class CoordinateTransform:
1010
"""Abstract coordinate transform with dimension & coordinate names.
1111
12-
EXPERIMENTAL (not ready for public use yet).
13-
12+
.. caution::
13+
This API is experimental and subject to change. Please report any bugs or surprising
14+
behaviour you encounter.
1415
"""
1516

1617
coord_names: tuple[Hashable, ...]

xarray/core/indexes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,14 +1455,15 @@ def rename(self, name_dict, dims_dict):
14551455
class CoordinateTransformIndex(Index):
14561456
"""Helper class for creating Xarray indexes based on coordinate transforms.
14571457
1458-
EXPERIMENTAL (not ready for public use yet).
1459-
14601458
- wraps a :py:class:`CoordinateTransform` instance
14611459
- takes care of creating the index (lazy) coordinates
14621460
- supports point-wise label-based selection
14631461
- supports exact alignment only, by comparing indexes based on their transform
14641462
(not on their explicit coordinate labels)
14651463
1464+
.. caution::
1465+
This API is experimental and subject to change. Please report any bugs or surprising
1466+
behaviour you encounter.
14661467
"""
14671468

14681469
transform: CoordinateTransform

0 commit comments

Comments
 (0)