-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,9 +176,9 @@ def the_function_to_deprecate(): | |
|
||
if obj_type is not None: | ||
warn_deprecated( | ||
"3.0", "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.") | ||
"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 commentThe 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! |
||
|
||
def deprecate(obj, message=message, name=name, alternative=alternative, | ||
pending=pending, addendum=addendum): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. obj_type has no effect and is deprecated. |
||
alternative="figure") | ||
if figure is None: | ||
figure = fig | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
alternative="figure") | ||
if figure is None: | ||
figure = fig | ||
|
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?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.