Skip to content

DOC: omit basic_units helper from gallery#31909

Draft
LiJzd wants to merge 4 commits into
matplotlib:mainfrom
LiJzd:doc-ignore-basic-units-gallery
Draft

DOC: omit basic_units helper from gallery#31909
LiJzd wants to merge 4 commits into
matplotlib:mainfrom
LiJzd:doc-ignore-basic-units-gallery

Conversation

@LiJzd

@LiJzd LiJzd commented Jun 16, 2026

Copy link
Copy Markdown

DOC: omit basic_units helper from gallery

PR summary

This PR prevents galleries/examples/units/basic_units.py from being rendered as a standalone gallery page. The file is a helper module used by the units examples, not a visual gallery example, and issue #17479 notes that it should likely be omitted from the gallery listing.

The file is still copied into the generated gallery output via copyfile_regex, so existing examples can continue to import it and users can still download it from links such as :download:\basic_units.py <basic_units.py>``.

Addresses one item from #17479.

AI Disclosure

I used Codex to inspect the issue, read the repository documentation, identify the smallest scoped change, and run local checks. I reviewed the resulting configuration change and verified the regex behavior locally.

PR checklist

  • "closes #0000" is in the body of the PR description to link the related issue
  • new and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New Features and API Changes are noted with a directive and release note
  • Documentation complies with general and docstring guidelines

Testing

  • git diff --check
  • python -m py_compile doc/conf.py
  • Local regex check confirming:
    • ../galleries/examples/units/basic_units.py matches ignore_pattern
    • ../galleries/examples/units/basic_units.py matches copyfile_regex
    • ordinary .rst files still match copyfile_regex
    • ordinary example .py files such as bar_unit_demo.py do not match either rule

Full documentation build was not run locally because this environment does not have Matplotlib's documentation dependencies installed, including sphinx_gallery.

@github-actions

Copy link
Copy Markdown

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process.

You can also join us on discourse chat for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@github-actions github-actions Bot added the Documentation: examples files in galleries/examples label Jun 16, 2026
@github-actions github-actions Bot added the Documentation: user guide files in galleries/users_explain or doc/users label Jun 16, 2026

@story645 story645 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I broadly support this (thanks!) - I think this file is more confusing than helpful as a gallery example - but am confused about the notebook piece.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why add this?

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

Labels

Documentation: build building the docs Documentation: examples files in galleries/examples Documentation: user guide files in galleries/users_explain or doc/users first-contribution

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants