FIX: add base kwarg to symlognor#16404
Conversation
8c1fee8 to
fdb00b0
Compare
lib/matplotlib/colors.py
Outdated
| (-*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.
Is there a guide on which arguments we may/want to make keyword-only?
There was a problem hiding this comment.
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.
I am talking only about the added one.
There was a problem hiding this comment.
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.
Sure, are you guys asking that just the new param is kwarg only, or all of them?
There was a problem hiding this comment.
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
SymLogNormhas 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
basekwarg, 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=10rather thannp.e.This was discussed on the Feb 3 Dev call.
PR Checklist