-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add color normalization parameter to plot_topomap #9468
Conversation
That sounds slightly nicer to me, but the results should be the same either way (right?). So I'd say do whatever you think leads to easier to understand / cleaner code. |
I think there's an even simpler (but less flexible) option: in addition to |
I prefer passing a norm rather than passing vmin/vmid/vmax. More flexible, not hard to code on our end, and allows, e.g., logarithmic norms if someone wanted that. |
Yes, it's exactly the same. I'll think about it. Any preference for |
slight preference for |
I've added a Notes section, and I'm now always using a normalizer internally. If both |
Warning is preferred any time we're ignoring user input, I think. |
Any idea what's up with CircleCI ( |
no idea, I always ask @GuillaumeFavelier when pyvista fails on the CIs https://app.circleci.com/pipelines/github/mne-tools/mne-python/8624/workflows/daf68146-3366-46a7-b809-1fdf7b221e6f/jobs/29702/steps?invite=true#step-118-71 |
Circle failures will be fixed by pyvista/pyvista#1398 |
@GuillaumeFavelier I'm pretty sure the error in Main Notebook are not related to my changes - do you know what's causing this? |
It seems to be related to a recent change in |
6444ce3
to
d6ac3cb
Compare
Other than the pip-pre jobs timing out this is ready for review. |
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.
just a nitpick, I think it reads a little clearer now but if you disagree @cbrnr feel free to disregard.
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.
Just a few minor things from me, otherwise LGTM
Co-authored-by: Daniel McCloy <dan@mccloy.info>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Any idea what's up with CircleCI?
|
Seems like this file doesn't exist: http://deb.debian.org/debian/pool/main/g/graphviz/ There's a file called libpathplan4_2.40.1-6+deb10u1_amd64.deb - maybe the package cache doesn't get refreshed? |
hopefully just a temporary internet snafu, I restarted it. If I paste the link into a browser tab it does prompt me to download a deb file. |
Yes, you're right, it does download the file locally. |
There is a fix in #9484 ( |
Finally all CIs are green! @larsoner feel free to merge. |
Thanks @cbrnr ! |
* Add color normalization parameter to plot_topomap * Add Notes * Warn if both cnorm and vmin/vmax are passed * Add test * Add versionadded tag * Indent versionadded * Add changelog entry * Make test work with older matplotlib versions * Use old-style numpy RNG * Update mne/viz/topomap.py Co-authored-by: Daniel McCloy <dan@mccloy.info> * FIX: Intersphinx * Add versionadded tag Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/viz/topomap.py Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Type-check Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Move import to top of function Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/viz/topomap.py Co-authored-by: Eric Larson <larson.eric.d@gmail.com> Co-authored-by: Daniel McCloy <dan@mccloy.info> Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Fixes #9466. Things to do/discuss:
cnorm
(for "color normalization"), because I think this better describes its purpose. It also avoids a name clash with an already existing local namenorm
(which has something to do with the L2 norm, not entirely sure). However, Matplotlib calls this parameternorm
, so if we want to mimic their naming scheme we could also call our parameternorm
instead.cnorm
, simultaneously passingvmin
andvmax
is deprecated, because these are already defined in the normalizer. I've implemented a pretty blunt workaround, but we could instead define a default linear normalizer withvmin
andvmax
and then never pass these explicitly.