From 2775d9b5ddc3a110a77a490c8f3d15c787a649e4 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Thu, 4 May 2017 01:01:19 +0200 Subject: [PATCH 1/3] DOC: don't include all methods/attributes of IntervalIndex --- doc/source/api.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/api.rst b/doc/source/api.rst index 491bec3c83f61..433c91c4bba57 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -1404,6 +1404,7 @@ CategoricalIndex .. autosummary:: :toctree: generated/ + :template: autosummary/class_without_autosummary.rst CategoricalIndex @@ -1432,6 +1433,7 @@ IntervalIndex .. autosummary:: :toctree: generated/ + :template: autosummary/class_without_autosummary.rst IntervalIndex From 1d46eb4cd8a5a9d465a596d4a57dbc841a3f6657 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Thu, 4 May 2017 15:06:32 -0500 Subject: [PATCH 2/3] Change docs for CategoricalIndex and IntervalIndex No autosummary with methods for them. Added to our hacks list in our numpydoc --- doc/source/api.rst | 1 - doc/sphinxext/numpydoc/numpydoc.py | 5 ++++- pandas/core/indexes/category.py | 3 +++ pandas/core/indexes/interval.py | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/source/api.rst b/doc/source/api.rst index 433c91c4bba57..c652573bc6677 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -618,7 +618,6 @@ strings and apply several methods to it. These can be accessed like Series.cat Series.dt Index.str - CategoricalIndex.str MultiIndex.str DatetimeIndex.str TimedeltaIndex.str diff --git a/doc/sphinxext/numpydoc/numpydoc.py b/doc/sphinxext/numpydoc/numpydoc.py index 0cccf72de3745..ed8e5fb4de5de 100755 --- a/doc/sphinxext/numpydoc/numpydoc.py +++ b/doc/sphinxext/numpydoc/numpydoc.py @@ -43,7 +43,10 @@ def mangle_docstrings(app, what, name, obj, options, lines, ) # PANDAS HACK (to remove the list of methods/attributes for Categorical) - if what == "class" and name.endswith(".Categorical"): + if what == "class" and (name.endswith(".Categorical") or + name.endswith("CategoricalIndex") or + name.endswith("Interval") or + name.endswith("IntervalIndex")): cfg['class_members_list'] = False if what == 'module': diff --git a/pandas/core/indexes/category.py b/pandas/core/indexes/category.py index 760db4ba20675..e7921dafabc3c 100644 --- a/pandas/core/indexes/category.py +++ b/pandas/core/indexes/category.py @@ -47,6 +47,9 @@ class CategoricalIndex(Index, base.PandasDelegate): name : object Name to be stored in the index + See Also + -------- + Categorical, Index """ _typ = 'categoricalindex' diff --git a/pandas/core/indexes/interval.py b/pandas/core/indexes/interval.py index ccd0d8bee4abc..518b3f99b64ec 100644 --- a/pandas/core/indexes/interval.py +++ b/pandas/core/indexes/interval.py @@ -110,6 +110,10 @@ class IntervalIndex(IntervalMixin, Index): Name to be stored in the index. copy : boolean, default False Copy the meta-data + + See Also + -------- + Index """ _typ = 'intervalindex' _comparables = ['name'] From 4dc57b4b21b4e549e787cc7a89fa52f0e73448c3 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Thu, 4 May 2017 15:17:53 -0500 Subject: [PATCH 3/3] Don't exclude Interval --- doc/sphinxext/numpydoc/numpydoc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/sphinxext/numpydoc/numpydoc.py b/doc/sphinxext/numpydoc/numpydoc.py index ed8e5fb4de5de..710c3cc9842c4 100755 --- a/doc/sphinxext/numpydoc/numpydoc.py +++ b/doc/sphinxext/numpydoc/numpydoc.py @@ -45,7 +45,6 @@ def mangle_docstrings(app, what, name, obj, options, lines, # PANDAS HACK (to remove the list of methods/attributes for Categorical) if what == "class" and (name.endswith(".Categorical") or name.endswith("CategoricalIndex") or - name.endswith("Interval") or name.endswith("IntervalIndex")): cfg['class_members_list'] = False