Visitar URL original
FIX: add base kwarg to symlognor by jklymak · Pull Request #16404 · matplotlib/matplotlib · GitHub
The Wayback Machine - https://web.archive.org/web/20200716203029/https://github.com/matplotlib/matplotlib/pull/16404
Skip to content
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

FIX: add base kwarg to symlognor #16404

Merged
merged 3 commits into from Feb 16, 2020
Merged

Conversation

@jklymak
Copy link
Contributor

jklymak commented Feb 4, 2020

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 specify base.

In 3.3. we may change the algorithm again slightly #16391, but will almost certainly default to base=10 rather than np.e.

This was discussed on the Feb 3 Dev call.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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
@jklymak jklymak added this to the v3.2.0 milestone Feb 4, 2020
@jklymak jklymak force-pushed the jklymak:fix-add-base-symlognorm branch 2 times, most recently from 8c1fee8 to fdb00b0 Feb 4, 2020
@@ -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,

This comment has been minimized.

Copy link
@tacaswell

tacaswell Feb 10, 2020

Member

This needs to go at the end.

This comment has been minimized.

Copy link
@jklymak

jklymak Feb 10, 2020

Author Contributor

Done...

This comment has been minimized.

Copy link
@Kojoley

Kojoley Feb 11, 2020

Member

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

This comment has been minimized.

Copy link
@jklymak

jklymak Feb 11, 2020

Author Contributor

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

This comment has been minimized.

Copy link
@Kojoley

Kojoley Feb 11, 2020

Member

I am talking only about the added one.

This comment has been minimized.

Copy link
@timhoffm

timhoffm Feb 15, 2020

Member

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

This comment has been minimized.

Copy link
@jklymak

jklymak Feb 15, 2020

Author Contributor

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

This comment has been minimized.

Copy link
@timhoffm

timhoffm Feb 16, 2020

Member

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

@jklymak jklymak force-pushed the jklymak:fix-add-base-symlognorm branch from fdb00b0 to e16a257 Feb 10, 2020
@jklymak jklymak requested review from dstansby and tacaswell Feb 10, 2020
doc/api/next_api_changes/behaviour.rst Outdated Show resolved Hide resolved
lib/matplotlib/colors.py Outdated Show resolved Hide resolved
jklymak and others added 3 commits Feb 10, 2020
Co-Authored-By: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-Authored-By: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
@jklymak jklymak force-pushed the jklymak:fix-add-base-symlognorm branch from f6f3963 to fe5fdf8 Feb 16, 2020
@Kojoley Kojoley merged commit 3a8e75e into matplotlib:master Feb 16, 2020
21 checks passed
21 checks passed
LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No new or fixed alerts
Details
Travis CI - Pull Request Build Passed
Details
ci/circleci: docs-python36 Your tests passed on CircleCI!
Details
ci/circleci: docs-python37 Your tests passed on CircleCI!
Details
ci/circleci: docs-python38 Your tests passed on CircleCI!
Details
codecov/patch 100.00% of diff hit (target 50.00%)
Details
codecov/project/library 75.18% (target 50.00%)
Details
codecov/project/tests 99.28% (+2.00%) compared to 6a8e39f
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
matplotlib.matplotlib Build #20200216.3 succeeded
Details
matplotlib.matplotlib (Job Linux_py36) Job Linux_py36 succeeded
Details
matplotlib.matplotlib (Job Linux_py37) Job Linux_py37 succeeded
Details
matplotlib.matplotlib (Job Linux_py38) Job Linux_py38 succeeded
Details
matplotlib.matplotlib (Job Windows_py36) Job Windows_py36 succeeded
Details
matplotlib.matplotlib (Job Windows_py37) Job Windows_py37 succeeded
Details
matplotlib.matplotlib (Job Windows_py38) Job Windows_py38 succeeded
Details
matplotlib.matplotlib (Job Windows_pyPre) Job Windows_pyPre succeeded
Details
matplotlib.matplotlib (Job macOS_py36) Job macOS_py36 succeeded
Details
matplotlib.matplotlib (Job macOS_py37) Job macOS_py37 succeeded
Details
matplotlib.matplotlib (Job macOS_py38) Job macOS_py38 succeeded
Details
@meeseeksdev
Copy link

meeseeksdev bot commented Feb 16, 2020

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 to suggest an improvement.

tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Feb 16, 2020
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
jklymak added a commit that referenced this pull request Feb 21, 2020
…-v3.2.x

Merge pull request #16404 from jklymak/fix-add-base-symlognorm
@jklymak jklymak deleted the jklymak:fix-add-base-symlognorm branch Feb 26, 2020
@jklymak jklymak mentioned this pull request Feb 26, 2020
0 of 6 tasks complete
@QuLogic
Copy link
Member

QuLogic commented Apr 25, 2020

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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.