From f8e32c257de2ff418f2bbd3dbe202e6bc824f543 Mon Sep 17 00:00:00 2001 From: Arnau Casau <47946624+arnaucasau@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:25:59 +0200 Subject: [PATCH] Move methods into class pages for docs (#1958) Co-authored-by: Jun Doi --- docs/_templates/autosummary/class.rst | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/docs/_templates/autosummary/class.rst b/docs/_templates/autosummary/class.rst index e4d661a008..422dfea255 100644 --- a/docs/_templates/autosummary/class.rst +++ b/docs/_templates/autosummary/class.rst @@ -8,20 +8,17 @@ .. currentmodule:: {{ module }} .. autoclass:: {{ objname }} + :show-inheritance: :no-members: :no-inherited-members: :no-special-members: {% block attributes_summary %} {% if attributes %} - .. rubric:: Attributes - - .. autosummary:: - :toctree: ../stubs/ {% for item in all_attributes %} {%- if not item.startswith('_') %} - {{ name }}.{{ item }} + .. autoattribute:: {{ name }}.{{ item }} {%- endif -%} {%- endfor %} {% endif %} @@ -29,19 +26,17 @@ {% block methods_summary %} {% if methods %} - .. rubric:: Methods - - .. autosummary:: - :toctree: ../stubs/ {% for item in all_methods %} - {%- if not item.startswith('_') or item in ['__call__', '__mul__', '__getitem__', '__len__'] %} - {{ name }}.{{ item }} + {%- if item not in inherited_members %} + {%- if not item.startswith('_') or item in ['__call__', '__mul__', '__getitem__', '__len__'] %} + .. automethod:: {{ name }}.{{ item }} + {%- endif -%} {%- endif -%} {%- endfor %} {% for item in inherited_members %} {%- if item in ['__call__', '__mul__', '__getitem__', '__len__'] %} - {{ name }}.{{ item }} + .. automethod:: {{ name }}.{{ item }} {%- endif -%} {%- endfor %}