Skip to content
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

Limit documenting special members to __call__ #20081

Merged
merged 1 commit into from
May 20, 2021

Conversation

timhoffm
Copy link
Member

Let's try and see if this works.

Closes #20080.

Follow up to #17151.

@QuLogic
Copy link
Member

QuLogic commented Apr 26, 2021

Fails with only one warning:

doc/devel/documenting_mpl.rst:709: WARNING: py:obj reference target not found: matplotlib.patches.Patch.__init__

@@ -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

@@ -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.

@jklymak jklymak requested review from jklymak and tacaswell and removed request for jklymak May 10, 2021 21:59
@QuLogic QuLogic merged commit 6768ef8 into matplotlib:master May 20, 2021
@QuLogic QuLogic added this to the v3.5.0 milestone May 20, 2021
@timhoffm timhoffm deleted the doc-special-members branch May 20, 2021 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API docs currently include entries for class __dict__, __module__, __weakref__
4 participants