Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
Mar 11, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 26, 2020

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.).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added this to the v3.3.0 milestone Feb 26, 2020
@anntzer anntzer changed the title Deprecate arg-less calls to subplot_class_factory (and similar factor… Deprecate arg-less calls to subplot_class_factory (and similar factories) Feb 26, 2020
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.")
Copy link
Member

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.

Copy link
Contributor Author

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).

@anntzer anntzer force-pushed the axesclassfactory-default branch from e6e1599 to eb9d28e Compare February 28, 2020 00:45
@@ -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 "
Copy link
Member

@QuLogic QuLogic Mar 11, 2020

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.

Copy link
Contributor Author

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.).
@anntzer
Copy link
Contributor Author

anntzer commented Mar 11, 2020

rebased, I think that's the last one for now so I'll let either of you do the merge :)

@jklymak jklymak merged commit 4764452 into matplotlib:master Mar 11, 2020
@anntzer anntzer deleted the axesclassfactory-default branch March 11, 2020 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants