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 colorbars for Norms that do not have a scale.#16392

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

Conversation

jklymak
Copy link
Member

@jklymakjklymak commentedFeb 3, 2020
edited
Loading

PR Summary

If a norm that did not have a corresponding scale is used, then the colorbar was not working. This PR (thanks@dstansby) now keeps track of the scale associated with the colorbar and if it is "manual" then falls back to the manual method of creating the colorbar.

Replaces#16286

Closes#16280

Note there are still issues with SymLogNorm, but this fix is regardless of that.

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 3, 2020
@jklymakjklymak added Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: color/colorbar labelsFeb 3, 2020
@codecov
Copy link

codecovbot commentedFeb 3, 2020

Codecov Report

Merging#16392 intomaster willdecrease coverage by0.00%.
The diff coverage isn/a.

Impacted file tree graph

@@            Coverage Diff             @@##           master   #16392      +/-   ##==========================================- Coverage   80.85%   80.85%   -0.01%==========================================  Files         307      307                Lines       75745    75754       +9       Branches     9690     9693       +3     ==========================================+ Hits        61245    61250       +5- Misses      11961    11964       +3- Partials     2539     2540       +1
Impacted FilesCoverage Δ
lib/matplotlib/backends/backend_macosx.py40.65% <0.00%> (ø)⬆️
lib/matplotlib/backends/qt_compat.py51.57% <0.00%> (ø)⬆️
lib/matplotlib/backends/backend_qt5.py57.37% <0.00%> (ø)⬆️
lib/matplotlib/backends/backend_wx.py49.94% <0.00%> (ø)⬆️
lib/matplotlib/font_manager.py75.27% <0.00%> (ø)⬆️
lib/matplotlib/colors.py88.09% <0.00%> (-0.26%)⬇️
lib/matplotlib/cbook/__init__.py76.87% <0.00%> (ø)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update7a2971b...e175ffc. Read thecomment docs.

@jklymakjklymakforce-pushed thefix-properly-fallback-noscale branch frome175ffc to6331db8CompareFebruary 3, 2020 04:32
@greglucas
Copy link
Contributor

There are multiple PRs out fixing various portions of theSymLog routines right now. I don't think that this one makes sense because you're going to add this new image test that will just fail and need to be updated immediately when you change the base scaling as proposed in the other ones.

I think it would be helpful to take a step back and rework the entire machinery at once rather than piecemealing it together.

@jklymak
Copy link
MemberAuthor

This is orthogonal to whether the norm is correct or not, and this basically will be the system in place once the norm is sorted out. So I agree that the image test will need to change again, but I think this small change has more chance of getting in and affects other norms rather urgently. So I'd argue thats worth the extra image in the repo.

@anntzer
Copy link
Contributor

We could also just take it on faith (aka local manual testing) that the new approach is better (after all we've been doing "fine" (or not so fine...) without a proper test for years now), push this first fix without the baseline image test, and put a proper test once everything is settled.

@jklymakjklymak mentioned this pull requestFeb 3, 2020
@jklymakjklymakforce-pushed thefix-properly-fallback-noscale branch from6331db8 toe23338fCompareFebruary 3, 2020 17:45
@jklymak
Copy link
MemberAuthor

OK, I opened#16398 to remind us to re-add@dstansby's test when the norms are settle down, and took the image test and image out of this PR.

I think this PR should still go in to fix the problem with the bad colorbars.

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

modulo making_scale ->__scale to make it more private (to make sure it does to leak)

@anntzer
Copy link
Contributor

I don't think we have double-underscore prefixed things anywhere in mpl, why would this one need to be more private?

@tacaswell
Copy link
Member

paranoia

@jklymakjklymakforce-pushed thefix-properly-fallback-noscale branch frome23338f to0e24001CompareFebruary 3, 2020 20:46
@jklymak
Copy link
MemberAuthor

I am ambivalent towards whether its__scale or_scale. Right now I have tow underscores, but if you'd like it changed, I can easily do that.

@anntzer
Copy link
Contributor

I actually prefer single underscore quite strongly here; I don't want to start creating "two levels" of private attributes and give the impression that some (single-underscore) private attributes are "more ok" to use as semi-public API than others (double-underscore), nor do I want to have mass-PRs replacing single underscores by doubles...

@jklymak
Copy link
MemberAuthor

I didn't really understand the argument for two underscores, but just did as@tacaswell suggested. Suggest he engages with you on this ;-)

@efiringefiring merged commitee2691c intomatplotlib:masterFeb 10, 2020
@jklymakjklymak deleted the fix-properly-fallback-noscale branchFebruary 10, 2020 20:35
@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 ee2691c3f8578b48e1b796df31672a91b88f6d97
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #16392: FIX colorbars for Norms that do not have a scale.'
  1. Push to a named branch :
git push YOURFORK v3.2.x:auto-backport-of-pr-16392-on-v3.2.x
  1. Create a PR against branch v3.2.x, I would have named this PR:

"Backport PR#16392 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.

jklymak pushed a commit to jklymak/matplotlib that referenced this pull requestFeb 10, 2020
jklymak added a commit that referenced this pull requestFeb 10, 2020
…3.2.xBackport PR#16392: FIX colorbars for Norms that do not have a scale.
@QuLogic
Copy link
Member

Note that__ is not just "extra" private; in a class, it means it's not available to subclasses as well (because it's renamed to_ClassName_attribute).

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

@tacaswelltacaswelltacaswell approved these changes

@dstansbydstansbydstansby approved these changes

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

Successfully merging this pull request may close these issues.

SymLogNorm colorbar incorrect on master
7 participants
@jklymak@greglucas@anntzer@tacaswell@QuLogic@dstansby@efiring

[8]ページ先頭

©2009-2025 Movatter.jp