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

Skip to content

Restructure boilerplate.py #13744

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
Mar 25, 2019
Merged

Conversation

timhoffm
Copy link
Member

PR Summary

This is preparatory work to make boilerplate.py more modular an flexible. The aim is to generate Figure-related functions in a future PR.

For easier review, this PR does only refactor, but does not yet change functionality. This can be seen by the fact that the generated pyplot.py is not changed.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

This looks OK to me. Probably good if @anntzer or someone else more familiar w/ the boilerplate logic made sure it wasn't going to be a problem.

At some point can you say more about the end goal here?

Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

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

I think I can guess what the next step will be :)

@timhoffm
Copy link
Member Author

timhoffm commented Mar 24, 2019

We'll the "end goal" sounds greater than it actually is. 😄

I just realized there are a couple of manually maintained functions like

@docstring.copy(Figure.ginput)
def ginput(*args, **kwargs):
    return gcf().ginput(*args, **kwargs)

Since we have the logic already in place for Axes it's reasonable to extend it to figures and let boilerplate.py handle these functions. The advantage is that boilerplate.py replicates the full signature and not just *args, **kwargs. This enables code-analysis based features to work, e.g. tab-completion in ipython and parameter checking in IDEs.

@jklymak jklymak merged commit 4adf436 into matplotlib:master Mar 25, 2019
@timhoffm timhoffm deleted the restructure-boilerplate branch March 25, 2019 21:29
@QuLogic QuLogic added this to the v3.2.0 milestone Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants