-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8c1fee8
to
fdb00b0
Compare
lib/matplotlib/colors.py
Outdated
@@ -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, |
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.
This needs to go at the end.
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.
Done...
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.
Is there a guide on which arguments we may/want to make keyword-only?
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.
Not really, but in this case, we can't really make any of then kwarg only because of back-compatibility concerns.
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.
I am talking only about the added one.
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.
As proposed in #16181, I‘d make almost all arguments kw-only. This will in particular also hold for added parameters.
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.
Sure, are you guys asking that just the new param is kwarg only, or all of them?
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.
For now, only the new parameter base can be kw-only. Making other parameters kw-only needs a deprecation first.
fdb00b0
to
e16a257
Compare
Co-Authored-By: Tim Hoffmann <[email protected]>
Co-Authored-By: Tim Hoffmann <[email protected]>
f6f3963
to
fe5fdf8
Compare
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
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 to suggest an improvement. |
FIX: add base kwarg to symlognor Conflicts: 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
…-v3.2.x Merge pull request #16404 from jklymak/fix-add-base-symlognorm
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. |
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 a
base
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 to
base=10
rather thannp.e
.This was discussed on the Feb 3 Dev call.
PR Checklist