-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
BUG: correct the scaling in the floating-point slop test. #11591
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
jklymak
left a comment
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.
Looks right to me. Does this merit a test?
|
Ooops, though this fails |
|
That blows the lid off the worm can. Working on it. |
|
I think this is getting close to a reasonable solution. |
| return scale, offset | ||
|
|
||
|
|
||
| class _Edge_integer: |
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.
Needs some documentation!
| high = np.round(Base(step).ge(_vmax - best_vmin) / step) | ||
| ticks = np.arange(low, high + 1) * step + best_vmin + offset | ||
| nticks = ((ticks <= vmax) & (ticks >= vmin)).sum() | ||
| edge = _Edge_integer(step, offset) |
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.
Similarly, this whole block could use a couple lines of comment. I looked at this the other day, and worked my way through it, but on its face it looks more complicated than whats needed.
b688e2c to
9d33cb5
Compare
Closes matplotlib#11587. Tests were working by accident despite bugs in ticker.Base, but the bugs caused problems in some applications of MaxNLocator, as in matplotlib#11587. Since some user code may be relying on the buggy behavior, ticker.Base is left in place but deprecated, and its intended functionality is provided by a new private class, _Edge_integer. MaxNLocator and MultipleLocator are modified to use the new class, with minor cleanups and an additional bug fix along the way. Two new relevant test cases are added to TestMaxNLocator.
245fe2c to
74c2e7c
Compare
|
I think this is ready to go now, with the possible exception of a next_api_changes note for the deprecation of |
jklymak
left a comment
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.
LGTM! Thanks!
|
@efiring re-milestoned as 3.1 based on your deprecation tags. |
|
I would be happy to move the tags up to 3.0 if you are interested in squeezing this into 3.0. Leaving it as 3.1 is OK, too. |
tacaswell
left a comment
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.
Conditional on fixing the deprecation labels.
Also, clarify a downward-counting for-loop.
…g-point slop test.
…591-on-v3.0.x Backport PR #11591 on branch v3.0.x
Closes #11587.
PR Summary
PR Checklist