Small clean to SymmetricalLogLocator#14308
Merged
dstansby merged 4 commits intomatplotlib:masterfrom May 31, 2019
Merged
Conversation
QuLogic
reviewed
May 25, 2019
anntzer
reviewed
May 27, 2019
| # "simple" mode is when the range falls entirely within (-t, | ||
| # t) -- it should just display (vmin, 0, vmax) | ||
|
|
||
| # Determine which of the three ranges we have |
Contributor
There was a problem hiding this comment.
I think the whole thing can be simplified to
if -linthresh <= vmin <= vmax <= 0 or 0 <= vmin <= vmax <= linthresh:
return [vmin, vmax]
has_a = (vmin < -linthresh)
has_b = (-linthresh < vmin < linthresh or -linthresh < vmax < linthresh)
has_c = (linthresh < vmax)
Member
Author
There was a problem hiding this comment.
I think SymLogNorm needs quite a few more tests, which I plan to add in for 3.2 at some point; I think this is a good suggestion, but might save it for after I've written tests that exercise this logic properly.
anntzer
reviewed
May 27, 2019
anntzer
reviewed
May 27, 2019
| if has_a: | ||
| if has_b: | ||
| a_range = get_log_range(t, -vmin + 1) | ||
| a_range = get_log_range(linthresh, np.abs(vmin) + 1) |
Contributor
There was a problem hiding this comment.
can use (builtin) abs() instead of np.abs()
anntzer
approved these changes
May 27, 2019
timhoffm
approved these changes
May 27, 2019
Member
Author
|
Going to merge, since this has two approvals. |
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
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.
b, twithbase, linthresh-vmin, -vmax, usenp.abs(), as the intent is to make sure the value passed toget_log_range()is positive.