Deprecate unused 'origin' and 'extent' in tricontour and tricontour#30028
Deprecate unused 'origin' and 'extent' in tricontour and tricontour#30028BrunoWolf03 wants to merge 1 commit intomatplotlib:mainfrom BrunoWolf03:main
Conversation
| from matplotlib._api.deprecation import delete_parameter | ||
| from matplotlib import _docstring |
There was a problem hiding this comment.
| 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.
| @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.
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.
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). |
|
Did you intend to close this PR? I see that this PR uses your |
As recommended by @rcomer i just used the decorator to take care of the issue.