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

Skip to content

MNT: Cleanup docstring substitution mechanisms #28795

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 2 commits into from
Sep 30, 2024

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Sep 9, 2024

Inspired by #28746.

Since the module _docstring is internal, we can do this refactoring without deprecations.

It's probably easiest for review to go through the commits one after the other. Each is a simple change, but they often touch the same code so that separate PRs would depend on each other.

I've stripped this down for easier review. This is now two commits, which I suggest should be kept (i.e. please do not squash)

  • MNT: Make Substitution and _ArtistPropertiesSubstitution independent
    They do not have relevant functional overlap. Thus, it's simpler to keep them completely separated.
  • Rename _ArtistPropertiesSubstitution.update() to register()
    While it's internally a dict.update. The logical process is a registration to make the names publically available. Also,
    remove the possibility to pass a dict. Passing kwargs is enough and we can simplify the API to only one type of usage.

@timhoffm
Copy link
Member Author

timhoffm commented Sep 9, 2024

Possible future improvement: One could still rename interpd to something better. But I don't have a good name at hand right now and this PR is already large enough. I therefore suggest to defer further possible improvements to a separate PR.

@timhoffm timhoffm marked this pull request as ready for review September 9, 2024 16:03
@timhoffm timhoffm force-pushed the cleanup-docstring-substitution branch from 3a6901d to 3a319ee Compare September 9, 2024 16:21
@timhoffm timhoffm force-pushed the cleanup-docstring-substitution branch from 3a319ee to 4e2b127 Compare September 16, 2024 09:59
They do not have relevant functional overlap. Thus, it's simpler
to keep them completely separated.
While it's internally a dict.update. The logical process is a
registration to make the names publically available. Also,
remove the possibility to pass a dict. Passing kwargs is
enough and we can simplify the API to only one type of usage.
@timhoffm timhoffm force-pushed the cleanup-docstring-substitution branch from 4e2b127 to fe9479a Compare September 21, 2024 22:55
@ksunden ksunden merged commit 24c5048 into matplotlib:main Sep 30, 2024
41 of 43 checks passed
@timhoffm timhoffm deleted the cleanup-docstring-substitution branch September 30, 2024 23:55
@ksunden ksunden mentioned this pull request Oct 2, 2024
3 tasks
kyracho pushed a commit to kyracho/matplotlib that referenced this pull request Oct 10, 2024
* MNT: Make Substitution and _ArtistPropertiesSubstitution independent

They do not have relevant functional overlap. Thus, it's simpler
to keep them completely separated.

* Rename _ArtistPropertiesSubstitution.update() to register()

While it's internally a dict.update. The logical process is a
registration to make the names publically available. Also,
remove the possibility to pass a dict. Passing kwargs is
enough and we can simplify the API to only one type of usage.
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