-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate unused 'origin' and 'extent' in tricontour and tricontour #30028
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
base: main
Are you sure you want to change the base?
Conversation
from matplotlib._api.deprecation import delete_parameter | ||
from matplotlib import _docstring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from matplotlib._api.deprecation import delete_parameter | |
from matplotlib import _docstring | |
from matplotlib import _api, _docstring |
By convention we import our interal helper modules this way.
@delete_parameter("3.9", "tricontour", "origin") | ||
@delete_parameter("3.9", "tricontour", "extent") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@delete_parameter("3.9", "tricontour", "origin") | |
@delete_parameter("3.9", "tricontour", "extent") | |
@_api.delete_parameter("3.9", "origin") | |
@_api.delete_parameter("3.9", "extent") |
This is how you'd use the decorator. The func
parameter is not passed in explicitly but comes from the decoration.
That said, I'm not sure whether the decorator works for parameters passed via **kwargs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, "3.9" should be replaced with the version it is deprecated in (right now it looks like "3.11").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, I'm not sure whether the decorator works for parameters passed via
**kwargs
.
It's fine in **kwargs
, at least by documentation.
Also, tricontourf should have the same thing and there should be a deprecation note, see https://matplotlib.org/devdocs/devel/api_changes.html#announce-changes-deprecations-and-new-features (the fourth checkmark). |
As recommended by @rcomer i just used the decorator to take care of the issue.