Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Small clean to SymmetricalLogLocator#14308

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dstansby merged 4 commits intomatplotlib:masterfromdstansby:symlog-clean
May 31, 2019

Conversation

dstansby
Copy link
Member

  • Replace variable namesb, t withbase, linthresh
  • Add some more inline comments
  • Instead of doing-vmin, -vmax, usenp.abs(), as the intent is to make sure the value passed toget_log_range() is positive.

@dstansbydstansby added this to thev3.2.0 milestoneMay 27, 2019
@@ -2468,22 +2468,23 @@ def tick_values(self, vmin, vmax):
# "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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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)

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I thinkSymLogNorm needs quite a few more tests, which I plan to add in for3.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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

sure

if has_a:
if has_b:
a_range = get_log_range(t, -vmin + 1)
a_range = get_log_range(linthresh, np.abs(vmin) + 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

can use (builtin) abs() instead of np.abs()

@dstansby
Copy link
MemberAuthor

Going to merge, since this has two approvals.

@dstansbydstansby merged commitfdc7a8c intomatplotlib:masterMay 31, 2019
@dstansbydstansby deleted the symlog-clean branchMay 31, 2019 12:22
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@anntzeranntzeranntzer approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.2.0
Development

Successfully merging this pull request may close these issues.

4 participants
@dstansby@QuLogic@anntzer@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp