-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix usages of warn_deprecated() #12823
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
Fix usages of warn_deprecated() #12823
Conversation
@@ -1311,7 +1311,7 @@ def set_adjustable(self, adjustable, share=False): | |||
""" | |||
if adjustable == 'box-forced': | |||
cbook.warn_deprecated( | |||
"2.2", "box-forced", obj_type="keyword argument") | |||
"2.2", name="box-forced", obj_type="keyword argument") |
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.
passing obj_type is deprecated and has no effect. Probably doesn't make sense to have a deprecation warning trigger another deprecation warning if we can prevent it...
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.
Where is that? I cannot find a deprecation of obj_type
in the code. Have you maybe misinterpreded the docstring?
obj_type : str, optional
The object type being deprecated.
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.
It was deprecated in #11395 because it does nothing.
@@ -290,7 +290,8 @@ def get_subplot_params(self, figure=None, fig=None): | |||
parameters are from rcParams unless a figure attribute is set. | |||
""" | |||
if fig is not None: | |||
cbook.warn_deprecated("2.2", "fig", obj_type="keyword argument", | |||
cbook.warn_deprecated("2.2", name="fig", | |||
obj_type="keyword argument", |
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.
obj_type has no effect and is deprecated.
@@ -382,7 +383,8 @@ def get_subplot_params(self, figure=None, fig=None): | |||
"""Return a dictionary of subplot layout parameters. | |||
""" | |||
if fig is not None: | |||
cbook.warn_deprecated("2.2", "fig", obj_type="keyword argument", | |||
cbook.warn_deprecated("2.2", name="fig", | |||
obj_type="keyword argument", |
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.
ditto
This should probably get backported to the v3.0.x branch, if possible. It does not need to be backported to the v2.2.x branch because that version did not use the kwarg-only syntax. |
"for it will be removed %(removal)s.") | ||
"3.0", message="Passing 'obj_type' to the 'deprecated' decorator " | ||
"has no effect, and is deprecated since Matplotlib %(since)s; " | ||
"support for it will be removed %(removal)s.") |
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.
I got confused by this over here. This is not confusing at all!
To clarify the situation:
So the PR looks fine. |
@meeseeksdev backport to v3.0.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
Not sure why this needs a backport; the issue is tagged 3.1. |
PR Summary
Fixes #12817.