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

FIX: add base kwarg to symlognor#16404

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
Kojoley merged 3 commits intomatplotlib:masterfromjklymak:fix-add-base-symlognorm
Feb 16, 2020

Conversation

jklymak
Copy link
Member

PR Summary

SymLogNorm has a linear range that the docs stated was the same size as a decade in the logarithmic range. Except the logarithm being used in the code was base=np.e, not base=10, so it was not really a decade.

This PR prepares to change the default to 10 by adding abase kwarg, and warning if it is not specified. If a user wants to suppress the warning they should specifybase.

In 3.3. we may change the algorithm again slightly#16391, but will almost certainly default tobase=10 rather thannp.e.

This was discussed on the Feb 3 Dev call.

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@jklymakjklymak added this to thev3.2.0 milestoneFeb 4, 2020
@jklymakjklymak added topic: color/color & colormaps Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labelsFeb 4, 2020
@jklymakjklymakforce-pushed thefix-add-base-symlognorm branch 2 times, most recently from8c1fee8 tofdb00b0CompareFebruary 4, 2020 14:52
@@ -1213,7 +1213,7 @@ class SymLogNorm(Normalize):
*linthresh* allows the user to specify the size of this range
(-*linthresh*, *linthresh*).
"""
def __init__(self, linthresh, linscale=1.0,
def __init__(self, linthresh, linscale=1.0, base=None,
Copy link
Member

Choose a reason for hiding this comment

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

This needs to go at the end.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Done...

Copy link
Member

Choose a reason for hiding this comment

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

Is there a guide on which arguments we may/want to make keyword-only?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Not really, but in this case, we can't really make any of then kwarg only because of back-compatibility concerns.

Copy link
Member

Choose a reason for hiding this comment

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

I am talking only about the added one.

Copy link
Member

Choose a reason for hiding this comment

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

As proposed in#16181, I‘d make almost all arguments kw-only. This will in particular also hold for added parameters.

anntzer and Kojoley reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sure, are you guys asking that just the new param is kwarg only, or all of them?

Copy link
Member

Choose a reason for hiding this comment

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

For now, only the new parameter base can be kw-only. Making other parameters kw-only needs a deprecation first.

jklymakand others added3 commitsFebruary 15, 2020 17:00
Co-Authored-By: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-Authored-By: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
@jklymakjklymakforce-pushed thefix-add-base-symlognorm branch fromf6f3963 tofe5fdf8CompareFebruary 16, 2020 01:02
@KojoleyKojoley merged commit3a8e75e intomatplotlib:masterFeb 16, 2020
@lumberbot-app
Copy link

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.2.x$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 3a8e75ed151414ac15cbc0e6568f0d09fffdab31
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #16404: FIX: add base kwarg to symlognor'
  1. Push to a named branch :
git push YOURFORK v3.2.x:auto-backport-of-pr-16404-on-v3.2.x
  1. Create a PR against branch v3.2.x, I would have named this PR:

"Backport PR#16404 on branch v3.2.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free tosuggest an improvement.

tacaswell pushed a commit to tacaswell/matplotlib that referenced this pull requestFeb 16, 2020
FIX: add base kwarg to symlognorConflicts:doc/api/next_api_changes/behaviour.rst          - moved to            doc/api/prev_api_changes/api_changes_3.2.0/behavior.rst and re-worded.lib/matplotlib/colors.py          - implicitly backported converting the docstring to numpy            doc style.  Re-worded new docstring
jklymak added a commit that referenced this pull requestFeb 21, 2020
…-v3.2.xMerge pull request#16404 from jklymak/fix-add-base-symlognorm
@jklymakjklymak deleted the fix-add-base-symlognorm branchFebruary 26, 2020 03:27
@QuLogic
Copy link
Member

The deprecation here is all confusing. It's marked as since 3.3, but 3.3 is when the deprecation is supposed to go away. The deprecation message also never had any version numbers to indicate when things changed or will change. I don't know if changing this after one minor release is best without this information.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@KojoleyKojoleyKojoley approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

@dstansbydstansbyAwaiting requested review from dstansby

@tacaswelltacaswellAwaiting requested review from tacaswell

Assignees
No one assigned
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.topic: color/color & colormaps
Projects
None yet
Milestone
v3.2.0
Development

Successfully merging this pull request may close these issues.

5 participants
@jklymak@QuLogic@tacaswell@Kojoley@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp