-
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
MRG+1: better title in plot_compare_evokeds (closes #6165) #6173
MRG+1: better title in plot_compare_evokeds (closes #6165) #6173
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6173 +/- ##
==========================================
+ Coverage 89.01% 89.01% +<.01%
==========================================
Files 410 410
Lines 73883 73885 +2
Branches 12255 12256 +1
==========================================
+ Hits 65765 65767 +2
+ Misses 5223 5222 -1
- Partials 2895 2896 +1 |
mne/viz/evoked.py
Outdated
@@ -1875,6 +1875,9 @@ def plot_compare_evokeds(evokeds, picks=None, gfp=False, colors=None, | |||
_validate_type(vlines, (list, tuple), "vlines", "list or tuple") | |||
|
|||
picks = [] if picks is None else picks | |||
picked_a_type = isinstance(picks, str) and picks in _DATA_CH_TYPES_SPLIT | |||
if title is None and picked_a_type: |
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.
Why is the type check necessary? It's only gonna be in _DATA_CH_TYPES_SPLIT if it's a str anyways, and if it's not a str, it'll simply return false right?
And then you can drop 1878 and just have:
if title is None and picks in _DATA_CH_TYPES_SPLIT:
Otherwise I'm happy .. |
…ne-tools#6173) * better title in plot_compare_evokeds (closes mne-tools#6165) * use logger.info instead of warn * fix stupidity * simplify
…ne-tools#6173) * better title in plot_compare_evokeds (closes mne-tools#6165) * use logger.info instead of warn * fix stupidity * simplify
This PR:
logger.info
instead ofwarn
when truncating long titlesmne.viz.plot_compare_evokeds(..., picks='grad')
(or anypicks
that is a single channel type), sets title to the channel type instead of listing out (and truncating) channel names.