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

Skip to content

Deprecate accepting arbitrary parameters in some get_window_extent() methods #22123

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
Jan 6, 2022

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jan 6, 2022

PR Summary

This will align the API with the general .Artist.get_window_extent API.
All parameters were ignored anyway.

After the deprecation, we'll use get_window_extent(renderer=None).

"3.6",
message="Passing any argument except 'renderer' to "
"Axes.get_window_extent is deprecated in Matplotlib "
"%(since)s and will be removed %(removal)s")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think(?) that's basically

@_api.deprecated("3.6", "args")
@_api.deprecated("3.6", "kwargs")
def get_window_extend(self, *args, renderer=None, **kwargs): ...

Copy link
Member Author

Choose a reason for hiding this comment

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

That would warn for get_window_extent(renderer) and get_window_extent(renderer=r), which we should still support to be consistent with Artist.get_window_extent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I think the correct invocation is

@_api.delete_parameter("3.6", "args")
@_api.delete_parameter("3.6", "kwargs")
def gwe(self, renderer=None, *args, **kwargs): ...

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, yes. Sure.

@tacaswell
Copy link
Member

Missed @anntzer 's comment while reviewing. Slight preference to go with the tooling, but OK with it going in either way.

@timhoffm timhoffm force-pushed the get_window_extent2 branch from 22bb527 to 56b1ccb Compare January 6, 2022 12:56
@anntzer anntzer merged commit 04834bc into matplotlib:main Jan 6, 2022
@timhoffm timhoffm deleted the get_window_extent2 branch January 6, 2022 15:36
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