Skip to content

Commit 271ebe9

Browse files
authored
Update Custom Indexes section in api.rst (#10517)
1 parent c43a374 commit 271ebe9

File tree

6 files changed

+65
-45
lines changed

6 files changed

+65
-45
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: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,40 @@ and DataTree objects, respectively.
978978
core.coordinates.DataArrayCoordinates
979979
core.coordinates.DataTreeCoordinates
980980

981+
Indexes
982+
=======
983+
984+
Default, pandas-backed indexes built-in to Xarray:
985+
986+
.. autosummary::
987+
:toctree: generated/
988+
989+
indexes.PandasIndex
990+
indexes.PandasMultiIndex
991+
992+
993+
More complex indexes built-in to Xarray:
994+
995+
.. autosummary::
996+
:toctree: generated/
997+
998+
CFTimeIndex
999+
indexes.RangeIndex
1000+
indexes.NDPointIndex
1001+
1002+
1003+
Creating indexes
1004+
----------------
1005+
.. autosummary::
1006+
:toctree: generated/
1007+
1008+
cftime_range
1009+
date_range
1010+
date_range_like
1011+
indexes.RangeIndex.arange
1012+
indexes.RangeIndex.linspace
1013+
1014+
9811015
Universal functions
9821016
===================
9831017

@@ -1571,31 +1605,39 @@ Custom Indexes
15711605
==============
15721606
.. currentmodule:: xarray
15731607

1608+
Building custom indexes
1609+
-----------------------
1610+
1611+
These classes are building blocks for more complex Indexes:
1612+
15741613
.. autosummary::
15751614
:toctree: generated/
15761615

1577-
CFTimeIndex
1578-
indexes.RangeIndex
1616+
indexes.CoordinateTransform
15791617
indexes.CoordinateTransformIndex
15801618
indexes.NDPointIndex
15811619

1582-
Creating custom indexes
1583-
-----------------------
1584-
.. autosummary::
1585-
:toctree: generated/
1586-
1587-
cftime_range
1588-
date_range
1589-
date_range_like
1590-
indexes.RangeIndex.arange
1591-
indexes.RangeIndex.linspace
1620+
The Index base class for building custom indexes:
15921621

1593-
Building custom indexes
1594-
-----------------------
15951622
.. autosummary::
15961623
:toctree: generated/
15971624

1598-
indexes.CoordinateTransform
1625+
Index.from_variables
1626+
Index.concat
1627+
Index.stack
1628+
Index.unstack
1629+
Index.create_variables
1630+
Index.should_add_coord_to_array
1631+
Index.to_pandas_index
1632+
Index.isel
1633+
Index.sel
1634+
Index.join
1635+
Index.reindex_like
1636+
Index.equals
1637+
Index.roll
1638+
Index.rename
1639+
Index.copy
1640+
15991641

16001642
Tutorial
16011643
========
@@ -1702,14 +1744,6 @@ Advanced API
17021744
.. Missing:
17031745
.. ``DataTree.set_close``
17041746
1705-
Default, pandas-backed indexes built-in Xarray:
1706-
1707-
.. autosummary::
1708-
:toctree: generated/
1709-
1710-
indexes.PandasIndex
1711-
indexes.PandasMultiIndex
1712-
17131747
These backends provide a low-level interface for lazily loading data from
17141748
external file-formats or protocols, and can be manually invoked to create
17151749
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/dataarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6915,7 +6915,7 @@ def groupby(
69156915
:ref:`groupby`
69166916
Users guide explanation of how to group and bin data.
69176917
6918-
:doc:`xarray-tutorial:intermediate/01-high-level-computation-patterns`
6918+
:doc:`xarray-tutorial:intermediate/computation/01-high-level-computation-patterns`
69196919
Tutorial on :py:func:`~xarray.DataArray.Groupby` for windowed computation
69206920
69216921
:doc:`xarray-tutorial:fundamentals/03.2_groupby_with_xarray`

xarray/core/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9955,7 +9955,7 @@ def groupby(
99559955
:ref:`groupby`
99569956
Users guide explanation of how to group and bin data.
99579957
9958-
:doc:`xarray-tutorial:intermediate/01-high-level-computation-patterns`
9958+
:doc:`xarray-tutorial:intermediate/computation/01-high-level-computation-patterns`
99599959
Tutorial on :py:func:`~xarray.Dataset.Groupby` for windowed computation.
99609960
99619961
:doc:`xarray-tutorial:fundamentals/03.2_groupby_with_xarray`

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)