Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Generalize validation that pyplot commands are documented #24000

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
Oct 16, 2022

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Sep 24, 2022

Until now, the test made some exclusions (_NON_PLOT_COMMANDS) and reqired all functions to be documented in a single autosummary block.

This change ensures the documentation of the _NON_PLOT_COMMANDS and it allows the commands to be spread across arbitrary many autosummary sections. This is in preparation of regrouping the pyplot commands similar to the Axes documentation.

This also pending deprecates pyplot.get_plot_commands, which should not be a public function. I'm defensive by using pending, because if get_plot_commands is used somewhere, that's most likely some downstream lib and we want to give them time to adapt.

Correctness of this change is automatically tested by by passing test_pyplot.py::test_doc_pyplot_summary.

``matplotlib.pyplot.get_plot_commands``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

... is pending to be deprecated. This is considered internal and no end-user
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
... is pending to be deprecated. This is considered internal and no end-user
... pending deprecation. This is considered internal and no end-user

Copy link
Member

Choose a reason for hiding this comment

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

... is a pending deprecation is another option, but the construction pending to be reads super off to me

Copy link
Member

@QuLogic QuLogic Sep 29, 2022

Choose a reason for hiding this comment

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

Yes, 'pending' is a state (i.e., an adjective), not a verb. I guess 'pend' is apparently a verb, but it's not used with an object. So the deprecation may be pending, but you cannot 'pend a deprecation'.

It either 'is (in a state of) pending deprecation' or 'is a pending deprecation'.

@QuLogic QuLogic added this to the v3.7.0 milestone Sep 27, 2022
@story645
Copy link
Member

Uh I think something went wrong in the rebase 'cause I'm not seeing changes?

@timhoffm
Copy link
Member Author

Hm, will check later.

@timhoffm timhoffm marked this pull request as draft September 29, 2022 06:28
@timhoffm timhoffm marked this pull request as ready for review September 29, 2022 20:59
@timhoffm
Copy link
Member Author

@story645: fixed.

@story645
Copy link
Member

story645 commented Sep 29, 2022

Not as far as I can tell :/

@timhoffm
Copy link
Member Author

Rebased to fix CI.

Copy link
Member

@story645 story645 left a comment

Choose a reason for hiding this comment

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

See discussion btw. Elliot and me on the grammar of pending but also like I'm not actually keen on holding up a PR 'cause of grammar (edit: can self merge w/ or w/o changing sentence)

Until now, the test made some exclusions (_NON_PLOT_COMMANDS) and
reqired all functions to be documented in a single autosummary block.

This change ensures the documentation of the _NON_PLOT_COMMANDS
and it allows the commands to be spread across arbitrary many
autosummary sections. This is in preparation of regrouping the pyplot
commands similar to the Axes documentation.

This also pending deprecates `pyplot.get_plot_commands`, which should
not be a public function. I'm defensive by using pending, because if
`get_plot_commands` is used somewhere, that's most likely some
downstream lib and we want to give them time to adapt.

Co-authored-by: hannah <[email protected]>
@timhoffm timhoffm merged commit f4f9528 into matplotlib:main Oct 16, 2022
@timhoffm timhoffm deleted the pyplot-test branch October 16, 2022 10:38
QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Mar 30, 2023
The typing PR found that this was returning a generator [1], but this
was an error from matplotlib#24000, as 3.6 and earlier returned a list.

[1] matplotlib#24976 (comment)
Higgs32584 pushed a commit to Higgs32584/matplotlib that referenced this pull request Apr 17, 2023
The typing PR found that this was returning a generator [1], but this
was an error from matplotlib#24000, as 3.6 and earlier returned a list.

[1] matplotlib#24976 (comment)
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.

3 participants