Skip to content

Commit

Permalink
Move methods into class pages for docs (#1958)
Browse files Browse the repository at this point in the history
Co-authored-by: Jun Doi <doichan@jp.ibm.com>
  • Loading branch information
arnaucasau and doichanj authored Oct 18, 2023
1 parent e434c59 commit f8e32c2
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,35 @@
.. 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 %}
{% endblock %}

{% 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 %}

Expand Down

0 comments on commit f8e32c2

Please sign in to comment.