-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Use FixedFormatter only with FixedLocator #15507
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seems reasonable, but fails 15 tests! |
63bf548
to
27df784
Compare
4f9a9fe
to
332cb4a
Compare
jklymak
reviewed
Oct 31, 2019
332cb4a
to
88d178d
Compare
|
88d178d
to
c779568
Compare
jklymak
reviewed
Nov 1, 2019
578236a
to
29b63c7
Compare
jklymak
approved these changes
Nov 1, 2019
anntzer
reviewed
Dec 2, 2019
anntzer
previously approved these changes
Dec 2, 2019
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.
just one nit
29b63c7
to
d538802
Compare
anntzer
reviewed
Dec 2, 2019
actually a real (minor) thing to fix on the warning too
8481e72
to
a473ba1
Compare
a473ba1
to
4b5284f
Compare
Ping @anntzer warning fixed. |
anntzer
approved these changes
Dec 30, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
This PR prevents users from stumbling into #7122, #8779, #15501.
It does not technically fix them,
FixedFormatter
has a one-off bug with locators other thanFixedLocator
. But setting fixed labels at unknown positions is anyway not a good idea. So even if the one-off bug was fixedFixedFormatter
should only used withFixedLocator
.FixedFormatter
should not be used without aFixedLocator
(along the hierarchy of tick label setter methods).set_major/minor_formatter()
if aFixedFormatter
is set without aFixedLocator
. This may be debatable.One could set the formatter first and the locator afterwards, which would technically yield the correct result. However, I feel that setting the position first and the labels second is the natural way, and is actually done throughout the library.
No alternative: Since Formatters don't know about Locators
FixedFormatter
itself cannot check at runtime and we have to resort to this somewhat clumsy approach.And I strongly want some feedback on this potential problem from running code, because nobody reads the docs 😄.