Skip to content

Move AxisArtistHelpers to toplevel. #20214

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
Apr 23, 2023
Merged

Move AxisArtistHelpers to toplevel. #20214

merged 1 commit into from
Apr 23, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented May 12, 2021

The axisartist has a concept of "axis_artist_helper", which computes
various computations to draw slanted/curved axises. Confusingly,
AxisArtistHelper (and likewise AxisArtistHelperRectlinear) do not
define such helper classes; they are simply namespaces that hold the
{AxisArtistHelper,AxisArtistHelperRectlinear}.{Fixed,Floating} nested
classes which do define helpers. More specifically,
AxisArtistHelper.{Fixed,Floating} act as abstract base classes for
AxisArtistHelperRectlinear.{Fixed,Floating} which are actually usable.

In order to slightly disentangle this move the actual helper classes to
the toplevel (as _{Fixed,Floating}AxisArtistHelperBase and
_{Fixed,Floating}AxisArtistHelperRectlinear), keeping the old
"purely namespace" classes around for backcompat. (But note that end
users should never have to directly interact with these classes anyways
-- normally, they only construct GridHelpers which take care of the
interaction with AxisArtistHelpers; see e.g. the various axisartist
examples.)

More simply, this commit simply dedents most of the definitions of the
Helper classes.

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

@QuLogic
Copy link
Member

QuLogic commented May 13, 2021

I'm not sure if Rectlinear belongs at the end of the name, or at the beginning, or after Fixed/Floating. It does seem a bit odd at the end though.

@anntzer
Copy link
Contributor Author

anntzer commented May 16, 2021

I'm just trying to be consistent with GridHelper, which puts them at the end. But I don't have a strong opinion either way...

@jklymak jklymak marked this pull request as draft May 20, 2021 23:57
@anntzer anntzer marked this pull request as ready for review January 3, 2022 15:19
@anntzer
Copy link
Contributor Author

anntzer commented Oct 18, 2022

Probably best to wait for #22314 and #24210 to be merged first before rebasing this.

@anntzer
Copy link
Contributor Author

anntzer commented Nov 19, 2022

Rebased on top of #22314.

@ksunden
Copy link
Member

ksunden commented Apr 18, 2023

Doc warnings are related to the change, namely that the subclasses have references to (new) superclasses which are private and undocumented. Perhaps can simply be added to the ignore list, but should be addressed somehow

The axisartist has a concept of "axis_artist_helper", which computes
various computations to draw slanted/curved axises.  Confusingly,
`AxisArtistHelper` (and likewise `AxisArtistHelperRectlinear`) do *not*
define such helper classes; they are simply namespaces that hold the
`{AxisArtistHelper,AxisArtistHelperRectlinear}.{Fixed,Floating}` nested
classes which *do* define helpers.  More specifically,
`AxisArtistHelper.{Fixed,Floating}` act as abstract base classes for
`AxisArtistHelperRectlinear.{Fixed,Floating}` which are actually usable.

In order to slightly disentangle this move the actual helper classes to
the toplevel (as `_{Fixed,Floating}AxisArtistHelperBase` and
`_{Fixed,Floating}AxisArtistHelperRectlinear`), keeping the old
"purely namespace" classes around for backcompat.  (But note that end
users should never have to directly interact with these classes anyways
-- normally, they only construct GridHelpers which take care of the
interaction with AxisArtistHelpers; see e.g. the various axisartist
examples.)

More simply, this commit simply dedents most of the definitions of the
Helper classes.
@anntzer
Copy link
Contributor Author

anntzer commented Apr 20, 2023

Fixed; the remaining doc build warning seems unrelated (failure to get the version switcher).

@timhoffm timhoffm merged commit d77801e into matplotlib:main Apr 23, 2023
@anntzer anntzer deleted the aah branch April 23, 2023 21:41
@ksunden ksunden added this to the v3.8.0 milestone Apr 25, 2023
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