From dddb87d25096168357dd761d9305129daac71a91 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Sat, 23 Sep 2017 12:45:16 +0200 Subject: [PATCH 1/2] DOC: fix no autosummary for numerical index api pages --- doc/source/api.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/source/api.rst b/doc/source/api.rst index 96c7f68f57aaa..2b9578a53af7b 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -1426,8 +1426,23 @@ Numeric Index :template: autosummary/class_without_autosummary.rst RangeIndex + +.. autosummary:: + :toctree: generated/ + :template: autosummary/class_without_autosummary.rst + Int64Index + +.. autosummary:: + :toctree: generated/ + :template: autosummary/class_without_autosummary.rst + UInt64Index + +.. autosummary:: + :toctree: generated/ + :template: autosummary/class_without_autosummary.rst + Float64Index .. _api.categoricalindex: From cded21b10ac019b1c1ebc2cb0dce8e700ca3b7ee Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 25 Sep 2017 23:32:21 +0200 Subject: [PATCH 2/2] add classes to existing hack --- doc/source/api.rst | 15 --------------- doc/sphinxext/numpydoc/numpydoc.py | 7 ++++--- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/doc/source/api.rst b/doc/source/api.rst index 2b9578a53af7b..96c7f68f57aaa 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -1426,23 +1426,8 @@ Numeric Index :template: autosummary/class_without_autosummary.rst RangeIndex - -.. autosummary:: - :toctree: generated/ - :template: autosummary/class_without_autosummary.rst - Int64Index - -.. autosummary:: - :toctree: generated/ - :template: autosummary/class_without_autosummary.rst - UInt64Index - -.. autosummary:: - :toctree: generated/ - :template: autosummary/class_without_autosummary.rst - Float64Index .. _api.categoricalindex: diff --git a/doc/sphinxext/numpydoc/numpydoc.py b/doc/sphinxext/numpydoc/numpydoc.py index 710c3cc9842c4..f06915997c616 100755 --- a/doc/sphinxext/numpydoc/numpydoc.py +++ b/doc/sphinxext/numpydoc/numpydoc.py @@ -43,9 +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") or - name.endswith("CategoricalIndex") or - name.endswith("IntervalIndex")): + no_autosummary = [".Categorical", "CategoricalIndex", "IntervalIndex", + "RangeIndex", "Int64Index", "UInt64Index", + "Float64Index"] + if what == "class" and any(name.endswith(n) for n in no_autosummary): cfg['class_members_list'] = False if what == 'module':