Skip to content

[Doc]: clarify when and how to use boilerplate.py #27190

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

Open
story645 opened this issue Oct 25, 2023 · 1 comment
Open

[Doc]: clarify when and how to use boilerplate.py #27190

story645 opened this issue Oct 25, 2023 · 1 comment

Comments

@story645
Copy link
Member

story645 commented Oct 25, 2023

Documentation Link

No response

Problem

Per this discussion #27158 (comment), I (maybe other folk) are a bit confused on what the "do not edit" comments in pyplot mean given that boilerplate.py is never run automatically. Consensus seems to be that the process should be when changing the signature of a pyplot function, run boilerplate.py and commit those changes but that's not documented anywhere.

Suggested improvement

More clearly document using boilerplate.py by:

  1. changing the Autogen message to "generated by biolerplate.py, do not edit"
    AUTOGEN_MSG = """
    # Autogenerated by boilerplate.py. Do not edit as changes will be lost."""
  2. change the comment at the top of pyplot to something like "plotting signatures are generated by boilerplate.py, rerun when changing signatures and commit the changes
    # Note: The first part of this file can be modified in place, but the latter
    # part is autogenerated by the boilerplate.py script.
  3. add something like (note: this rst may be incorrect) to the coding guideline.
When a function in the :doc:`pyplot  API<doc/api/pyplot_summary>`, run :file:`lib/matplotlib/test_pyplot.py::test_pyplot_up_to_date`. If the test fails and and you intended to change those signatures, run boilerplate.py and commit the changes
@QuLogic QuLogic changed the title [Doc]: clarify when and how to use biolerplate.py [Doc]: clarify when and how to use boilerplate.py Oct 25, 2023
@QuLogic
Copy link
Member

QuLogic commented Oct 25, 2023

Consensus seems to be that the process should be when changing the signature of a pyplot function, run boilerplate.py and commit those changes but that's not documented anywhere.

This is generally true, though there are functions in there that are not part of the automatically generated set. An easier indicator is "if the lib/matplotlib/tests/test_pyplot.py::test_pyplot_up_to_date test fails", but one has to clarify that with "and you intended to change those signatures".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants