You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
This is complete for now, i.e. everything we can do right now for the removal is done.
Migration timeline:
3.11: Builtin scales, can be called with and without the axis parameter. register_scale() works for both, scales with and without an axis parameter. If an axis parameter is found, a pending deprecation warning is issued.
3.13: The pending deprecation will be changed to a full deprecation.
3.15: register_scale will raise an error if a scale with an axis parameter is found. The axis parameter is removed from builtin scales.
(optionally) 3.17 or later: Remove the introspection for an axis parameter from register_scale again. This would mean that register_scale will not catch the old scale signature. Instead it will raise later at usage of the scale. This would simplify registration code at the expense of more obscure error messages at runtime (but they typically should not happen anymore as their use has been deprecated for a reasonably long time).
Activity
MNT: Registered 3rd party scales do not need an axis parameter anymore
MNT: Registered 3rd party scales do not need an axis parameter anymore
MNT: Registered 3rd party scales do not need an axis parameter anymore
MNT: Registered 3rd party scales do not need an axis parameter anymore
MNT: Registered 3rd party scales do not need an axis parameter anymore
anntzer commentedon Jan 7, 2025
Downstream libraries: there's at least https://github.com/matplotlib/mpl-probscale.
timhoffm commentedon Jan 7, 2025
Yes, and some other usage, which means we'll take it slow through the full deprecation machinery, including a pending deprecation.
MNT: Registered 3rd party scales do not need an axis parameter anymore
MNT: Registered 3rd party scales do not need an axis parameter anymore
MNT: Registered 3rd party scales do not need an axis parameter anymore
MNT: Registered 3rd party scales do not need an axis parameter anymore
MNT: Registered 3rd party scales do not need an axis parameter anymore
MNT: Registered 3rd party scales do not need an axis parameter anymore (
timhoffm commentedon Aug 24, 2025
This is complete for now, i.e. everything we can do right now for the removal is done.
Migration timeline:
register_scale()works for both, scales with and without an axis parameter. If an axis parameter is found, a pending deprecation warning is issued.register_scalewill raise an error if a scale with an axis parameter is found. The axis parameter is removed from builtin scales.register_scaleagain. This would mean thatregister_scalewill not catch the old scale signature. Instead it will raise later at usage of the scale. This would simplify registration code at the expense of more obscure error messages at runtime (but they typically should not happen anymore as their use has been deprecated for a reasonably long time).