8000 [MNT]: Remove axis parameter from scales · Issue #29349 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

[MNT]: Remove axis parameter from scales #29349

New issue
< 8000 div class="px-4">

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

Open
timhoffm opened this issue Dec 19, 2024 · 2 comments
Open

[MNT]: Remove axis parameter from scales #29349

timhoffm opened this issue Dec 19, 2024 · 2 comments

Comments

@timhoffm
Copy link
Member
timhoffm commented Dec 19, 2024

Summary

For historic reasons, Scales take the axis as the first parameter. It's use is discouraged and none of our own scales actually use it at least since #12831.

To simplify our code, we should get rid of that parameter.

Proposed fix

Do we know whether

  • downstream libraries add their own Scales via register_scale()?
  • user will directly instantiate our own Scale classes?

If so we need the full deprecation machinery:

  1. Make scale_factory work with scales have or have not an initial axis parameter. Either by try-except with/without this parameter or by introspecting the signature.
  2. Introspect scale classes passed to register_scale and warn if they still have the axis argument.
  3. Make all our scales work with/without the axis parameter by adding a suitable decorator to their init functions.

Otherwise, we can simplify the transition.

--

Edit: Both questions are yes, so we need the full deprecation mechanism.

@anntzer
Copy link
Contributor
anntzer commented Jan 7, 2025

Downstream libraries: there's at least https://github.com/matplotlib/mpl-probscale.

@timhoffm
Copy link
Member Author
timhoffm commented Jan 7, 2025

Yes, and some other usage, which means we'll take it slow through the full deprecation machinery, including a pending deprecation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0