-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate old and little used formatters. #16170
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
Conversation
@@ -457,7 +458,8 @@ class TestIndexFormatter: | |||
(2, 'label2'), | |||
(2.5, '')]) | |||
def test_formatting(self, x, label): | |||
formatter = mticker.IndexFormatter(['label0', 'label1', 'label2']) | |||
with cbook._suppress_matplotlib_deprecation_warning(): | |||
formatter = mticker.IndexFormatter(['label0', 'label1', 'label2']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are deprecating, is there any reason to keep the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the usual policy is to get rid of the test only when the API is deprecated too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that makes sense because we can't break things until we can break them...
Actually let's ping @efiring in case he has any thought on this as he's probably the only one who was already around when these came in :) |
@@ -135,3 +135,8 @@ access the transform classes from the :mod:`.scale` module. | |||
``TexManager.cachedir`` | |||
~~~~~~~~~~~~~~~~~~~~~~~ | |||
Use `matplotlib.get_cachedir()` instead. | |||
|
|||
``OldScalarFormatter``, ``IndexFormatter`` and ``DateIndexFormatter`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the deprecation for OldScalarFormatter. While you are at it, maybe also deprecate OldAutoLocator. I think the renaming of these things to "Old" was probably done with eventual deprecation and removal in mind. The IndexFormatters also seem like good candidates for the trash bin. I can imagine NullFormatter being useful in a user interface as one of a choice of Formatters, but it's true, it can be trivially recreated directly or via FuncFormatter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, added it for OldScalarFormatter. Also deprecated OldAutoLocator.
NullFormatter is trivial to recreate with FuncFormatter (or even simpler, FormatStrFormatter("")
:-)), but I think it's widely used enough and its implementation so simple that we can leave it in, at least for now.
Self merge is fine after fixing the deprecations rebase |
- The new ScalarFormatter replaced OldScalarFormatter in 3910bb9 (2005). - IndexFormatter appeared in e66091d (2009) but was never used in the examples; IndexDateFormatter is unused in the docs since 4ea4b96 (2009); both can be fairly easily implemented in terms of FuncFormatter. I'm willing to back off the deprecations if there's demand to keep them, though.
examples; IndexDateFormatter is unused in the docs since 4ea4b96
(2009); both can be fairly easily implemented in terms of
FuncFormatter.
I'm willing to back off the deprecations if there's demand to keep them,
though.
PR Summary
PR Checklist