-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix doc references in subclasses of mpl._enum
members
#20174
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
Conversation
First attempt threw warnings after passing locally, I'll mark as draft until it's passing. |
f2733d2
to
bd5d341
Compare
Pretty sure the original strategy proposed (on a call during my post-graduation absence) of changing |
bd5d341
to
23457a1
Compare
Avoid using explicit references to private module in docs, instead let intersphinx handle it.
23457a1
to
c48dfad
Compare
Test failure seems unrelated, restarting CI... |
@brunobeltran how can we test this with other projects? Do you suggest merging and then just asking one of them to test their intersphinx? |
I'm not sure I'm following. Wasn't there the idea using ReST labels and references.
and
so that we're not dependent on name resolution at all? |
I'm not sure the original issue is still an issue, so I'll close this, but feel free to request a re-open. |
Avoid using explicit references to private module in docs, instead let
intersphinx handle it.
PR Summary
numpydoc
's xref breaks for external subclasses ofPatch
because we use references to.CapStyle
and.JoinStyle
(after importing those classes), but external library authors subclassing Patch are certainly not required to import them, so numpydoc cannot resolve the unqualified reference.We do not wish to expose the full reference,matplotlib._enum.CapStyle
(and similar forJoinStyle
) in order to avoid tieing ourselves to this experimental/private module as much as possible.Therefore, as mentioned here, this PR instead changes the references to the formCapStyle_
andJoinStyle_
to allow intersphinx to handle them.Trying to add the full reference
~matplotlib._enums.CapStyle
everywhere in the docstrings where it is relevant creates an absolute mess of docstring lines that are way too long in ways that can't be fixed. Since we're already using interpolation in most of the same places to list out the possible Join/CapStyles (%(JoinStyle)s
expands to('miter', 'round', 'bevel')
), we add%(JoinStyleL)s
that exands to``~matplotlib._enums.JoinStyle``
This should fix #19839.
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).