Skip to content

Merge ParasiteAxesAuxTransBase into ParasiteAxesBase. #18675

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
Oct 11, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Oct 6, 2020

It doesn't warrant being a separate mixin class (cf. merging of Subplot
into Axes -- flat is better than nested).

Also, currently mpl_toolkits axes mixins create non-picklable Axes
subclasses because they lack the same pickling machinery as the
standard SubplotBase mixin. It's not too hard to also set up the
same machinery for mpl_toolkits mixins (planned for a later PR), but
also supporting the double-mixin case (both ParasiteAxesBase and
ParasiteAxesAuxTransBase) adds unnecessary complications.

PR Summary

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and pydocstyle<4 and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@anntzer anntzer added this to the v3.4.0 milestone Oct 6, 2020
@anntzer anntzer force-pushed the parasite-auxtrans branch from 14ad460 to 1f79f5b Compare October 7, 2020 00:07
@@ -83,7 +83,7 @@ def test_ParasiteAxesAuxTrans():
ax1 = SubplotHost(fig, 1, 3, i+1)
fig.add_subplot(ax1)

ax2 = ParasiteAxesAuxTrans(ax1, IdentityTransform())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is test_ParasiteAxesAuxTrans; I don't think it should be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the functionality of ParasiteAxesAuxTrans was fully folded into ParasiteAxes, so it should still be tested -- just as part of ParasiteAxes. I guess I could rename the test to test_parasite_auxtrans?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But ParasiteAxesAuxTrans has a second copy of all that code, so if it's not tested, then it could break separately from ParasiteAxes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see; parametrized the test to check both classes.
this revealed that I needed to keep the __init__ on the AuxTransBase class too, because otherwise the deprecation machinery grabs object.__init__ instead and wraps that to install the deprecation emitter.

@anntzer anntzer force-pushed the parasite-auxtrans branch 2 times, most recently from a066844 to bbede52 Compare October 8, 2020 09:28
"""
Add a parasite axes to this host.

Despite this method's name, this should actually be thought of as an
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably add add_parasite_axes() in a followup PR and (soft-)deprecate get_aux_axes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this in another PR, as you say.

@timhoffm
Copy link
Member

Some tests must be adapted for liew_limit keyword-only.

It doesn't warrant being a separate mixin class (cf. merging of Subplot
into Axes -- flat is better than nested).

Also, currently mpl_toolkits axes mixins create non-picklable Axes
subclasses because they lack the same pickling machinery as the
standard SubplotBase mixin.  It's not too hard to also set up the
same machinery for mpl_toolkits mixins (planned for a later PR), but
also supporting the double-mixin case (both ParasiteAxesBase and
ParasiteAxesAuxTransBase) adds unnecessary complications.
@anntzer
Copy link
Contributor Author

anntzer commented Oct 11, 2020

hopefully fixed now

@timhoffm timhoffm merged commit b2802b5 into matplotlib:master Oct 11, 2020
@anntzer anntzer deleted the parasite-auxtrans branch October 11, 2020 20: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.

3 participants