Skip to content

Commit 8509e63

Browse files
jorisvandenbosschepcluo
authored andcommitted
DOC: don't include all methods/attributes of IntervalIndex (pandas-dev#16221)
* DOC: don't include all methods/attributes of IntervalIndex * Change docs for CategoricalIndex and IntervalIndex No autosummary with methods for them. Added to our hacks list in our numpydoc * Don't exclude Interval
1 parent d3cd709 commit 8509e63

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

doc/source/api.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ strings and apply several methods to it. These can be accessed like
618618
Series.cat
619619
Series.dt
620620
Index.str
621-
CategoricalIndex.str
622621
MultiIndex.str
623622
DatetimeIndex.str
624623
TimedeltaIndex.str
@@ -1404,6 +1403,7 @@ CategoricalIndex
14041403

14051404
.. autosummary::
14061405
:toctree: generated/
1406+
:template: autosummary/class_without_autosummary.rst
14071407

14081408
CategoricalIndex
14091409

@@ -1432,6 +1432,7 @@ IntervalIndex
14321432

14331433
.. autosummary::
14341434
:toctree: generated/
1435+
:template: autosummary/class_without_autosummary.rst
14351436

14361437
IntervalIndex
14371438

doc/sphinxext/numpydoc/numpydoc.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def mangle_docstrings(app, what, name, obj, options, lines,
4343
)
4444

4545
# PANDAS HACK (to remove the list of methods/attributes for Categorical)
46-
if what == "class" and name.endswith(".Categorical"):
46+
if what == "class" and (name.endswith(".Categorical") or
47+
name.endswith("CategoricalIndex") or
48+
name.endswith("IntervalIndex")):
4749
cfg['class_members_list'] = False
4850

4951
if what == 'module':

pandas/core/indexes/category.py

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ class CategoricalIndex(Index, base.PandasDelegate):
4747
name : object
4848
Name to be stored in the index
4949
50+
See Also
51+
--------
52+
Categorical, Index
5053
"""
5154

5255
_typ = 'categoricalindex'

pandas/core/indexes/interval.py

+4
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ class IntervalIndex(IntervalMixin, Index):
110110
Name to be stored in the index.
111111
copy : boolean, default False
112112
Copy the meta-data
113+
114+
See Also
115+
--------
116+
Index
113117
"""
114118
_typ = 'intervalindex'
115119
_comparables = ['name']

0 commit comments

Comments
 (0)