Skip to content

Commit 15ec346

Browse files
committed
Disable numpydoc and use autosummary instead
1 parent cf7f0af commit 15ec346

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

doc/_templates/autosummary/class.rst

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
1-
{% extends "!autosummary/class.rst" %}
1+
{{ fullname | escape | underline}}
22

3-
{% block methods %}
4-
{% if methods %}
3+
.. currentmodule:: {{ module }}
54

6-
..
7-
HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages.
8-
.. autosummary::
9-
:toctree:
10-
{% for item in all_methods %}
11-
{%- if not item.startswith('_') or item in ['__call__'] %}
12-
{{ name }}.{{ item }}
13-
{%- endif -%}
14-
{%- endfor %}
5+
.. autoclass:: {{ objname }}
156

16-
{% endif %}
17-
{% endblock %}
7+
{% block methods %}
188

19-
{% block attributes %}
20-
{% if attributes %}
9+
{% block attributes %}
10+
{% if attributes %}
11+
.. rubric:: {{ _('Attributes') }}
2112

22-
..
23-
HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages.
2413
.. autosummary::
25-
:toctree:
26-
{% for item in all_attributes %}
27-
{%- if not item.startswith('_') %}
28-
{{ name }}.{{ item }}
29-
{%- endif -%}
30-
{%- endfor %}
14+
{% for item in attributes %}
15+
{% if item in members and not item.startswith('_') %}
16+
~{{ name }}.{{ item }}
17+
{% endif %}
18+
{%- endfor %}
19+
{% endif %}
20+
{% endblock %}
21+
22+
{% if methods %}
23+
.. rubric:: {{ _('Methods') }}
3124

32-
{% endif %}
33-
{% endblock %}
25+
.. autosummary::
26+
{% for item in methods %}
27+
{% if item in members and (not item.startswith('_') or item in ['__call__']) %}
28+
~{{ name }}.{{ item }}
29+
{% endif %}
30+
{%- endfor %}
31+
{% endif %}
32+
{% endblock %}

doc/source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
autodoc_typehints = "none"
131131

132132
# numpydoc
133+
numpydoc_show_class_members = False
134+
numpydoc_show_inherited_class_members = False
133135
numpydoc_attributes_as_param_list = False
134136

135137
# matplotlib plot directive

0 commit comments

Comments
 (0)