Skip to content

Limit documenting special members to __call__ #20081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/_templates/autosummary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% if objtype in ['class'] %}
.. auto{{ objtype }}:: {{ objname }}
:show-inheritance:
:special-members:
:special-members: __call__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:special-members: __call__
:special-members: __call__,__init__

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not great. We don't want all the __init__ in the docs (https://57666-1385122-gh.circle-artifacts.com/0/doc/build/html/search.html?q=__init__). It's information is already available in the class docstring, e.g.

grafik


{% else %}
.. auto{{ objtype }}:: {{ objname }}
Expand Down
2 changes: 1 addition & 1 deletion doc/devel/documenting_mpl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ Then in any function accepting `~.Line2D` pass-through ``kwargs``, e.g.,
"""

Note there is a problem for `~matplotlib.artist.Artist` ``__init__`` methods,
e.g., `matplotlib.patches.Patch.__init__`, which supports ``Patch`` ``kwargs``,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't link __init__ as this is not an explicit entry in the docs. It's contents is folded into the class docstring.

e.g., `matplotlib.patches.Patch`, which supports ``Patch`` ``kwargs``,
since the artist inspector cannot work until the class is fully defined and
we can't modify the ``Patch.__init__.__doc__`` docstring outside the class
definition. There are some some manual hacks in this case, violating the
Expand Down