Skip to content

Commit a951249

Browse files
docs: Skip inherited methods, use autosummary only for big classes (#2470)
1 parent f70f93a commit a951249

File tree

1 file changed

+13
-2
lines changed
  • third_party/sphinx/ext/autosummary/templates/autosummary

1 file changed

+13
-2
lines changed

third_party/sphinx/ext/autosummary/templates/autosummary/class.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,41 @@
22

33
.. currentmodule:: {{ module }}
44

5+
{% set is_pandas = module.startswith("bigframes.pandas") or module.startswith("bigframes.geopandas") %}
6+
{% set skip_inherited = is_pandas and not module.startswith("bigframes.pandas.typing.api") %}
7+
8+
{% if is_pandas %}
59
.. autoclass:: {{ objname }}
610
:no-members:
711

8-
{% block methods %}
9-
1012
{% block attributes %}
1113
{% if attributes %}
1214
.. rubric:: {{ _('Attributes') }}
1315

1416
.. autosummary::
1517
:toctree:
1618
{% for item in attributes %}
19+
{%- if not skip_inherited or not item in inherited_members%}
1720
~{{ name }}.{{ item }}
21+
{%- endif %}
1822
{%- endfor %}
1923
{% endif %}
2024
{% endblock %}
2125

26+
{% block methods %}
2227
{% if methods %}
2328
.. rubric:: {{ _('Methods') }}
2429

2530
.. autosummary::
2631
:toctree:
32+
2733
{% for item in methods %}
34+
{%- if not skip_inherited or not item in inherited_members%}
2835
~{{ name }}.{{ item }}
36+
{%- endif %}
2937
{%- endfor %}
3038
{% endif %}
3139
{% endblock %}
40+
{% else %}
41+
.. autoclass:: {{ objname }}
42+
{% endif %}

0 commit comments

Comments
 (0)