Skip to content

Move the common implementation of Axes.set_x/y/zscale to Axis. #23500

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
Aug 3, 2022

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 28, 2022

... together with an _axis_method_wrapper.

It may be worth trying to figure out later whether Axis._set_scale and
Axis._set_axes_scale need to have subtly different behaviors...

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • 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).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

... together with an _axis_method_wrapper.

It may be worth trying to figure out later whether Axis._set_scale and
Axis._set_axes_scale need to have subtly different behaviors...
@oscargus
Copy link
Member

oscargus commented Aug 1, 2022

The 3D-versions were not tested earlier. Would be nice to have a test that passes both before and after this PR.

@anntzer
Copy link
Contributor Author

anntzer commented Aug 1, 2022

3D axes don't actually meaningfully support any scales other than linear, so I don't think we can really write meaningful tests there. Note that if anything this PR already improves the test coverage by getting rid of untested code (Axes3D.set_{x,y,z}scale).

Copy link
Member

@oscargus oscargus left a comment

Choose a reason for hiding this comment

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

It improves the coverage for sure, I'm more worried about not changing behaviour. But after a more careful reading of the code, I can probably agree with you that it does the same thing as before.

@tacaswell
Copy link
Member

The docs failure is understood as the sphinx-gallery reset issue, should not block.

The difference is that the autoscaling is now conditional, but I suspect that is OK.

@tacaswell tacaswell added this to the v3.6.0 milestone Aug 3, 2022
@tacaswell tacaswell merged commit 2d5a8ec into matplotlib:main Aug 3, 2022
@anntzer anntzer deleted the set_fooscale branch August 3, 2022 21:57
@oscargus oscargus mentioned this pull request Feb 26, 2023
6 tasks
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