-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate arg-less calls to subplot_class_factory (and similar factories) #16576
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
Conversation
cbook.warn_deprecated( | ||
"3.3", message="Support for passing None to " | ||
"parasite_axes_auxtrans_class_factory is deprecated; explicitly " | ||
"pass the default Axes class instead.") |
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.
Why not be explicit:
...; explicitly pass ParasiteAxes instead
.
Same for the other warnings.
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.
Done. For the others the default is Axes (well, whatever Axes is in that current module).
e6e1599
to
eb9d28e
Compare
@@ -186,6 +186,9 @@ def subplot_class_factory(axes_class=None): | |||
not have to be created for every type of Axes. | |||
""" | |||
if axes_class is None: | |||
cbook.warn_deprecated( | |||
"3.3", message="Support for passing None to subplot_class_factory " |
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.
Same thing about the alignment here (and below) as the other PR.
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.
at least for deprecations this pattern is common through the codebase, as can be checked with git grep -A2 'message='
)
…ies). Explicitly passing the base class is not too onerous; end users should typically not have to handle the arg-less case because we provide these classes at the toplevel anyways (`Subplot`, `ParasiteAxes`, etc.), and this refactor should ultimately help with factoring all these factories together, in particular to make mpl_toolkits Axes picklable (right now they aren't) without duplicating the somewhat heavy machinery that makes Subplots picklable (_picklable_subplot_class_constructor, etc.).
eb9d28e
to
479b8f8
Compare
rebased, I think that's the last one for now so I'll let either of you do the merge :) |
Explicitly passing the base class is not too onerous; end users should
typically not have to handle the arg-less case because we provide these
classes at the toplevel anyways (
Subplot
,ParasiteAxes
, etc.), andthis refactor should ultimately help with factoring all these factories
together, in particular to make mpl_toolkits Axes picklable (right now
they aren't) without duplicating the somewhat heavy machinery that makes
Subplots picklable (_picklable_subplot_class_constructor, etc.).
PR Summary
PR Checklist