Skip to content

MRG+1: better title in plot_compare_evokeds (closes #6165)#6173

Merged
larsoner merged 4 commits intomne-tools:masterfrom
drammock:fix_plot_compare_evokeds_title
Apr 22, 2019
Merged

MRG+1: better title in plot_compare_evokeds (closes #6165)#6173
larsoner merged 4 commits intomne-tools:masterfrom
drammock:fix_plot_compare_evokeds_title

Conversation

@drammock
Copy link
Copy Markdown
Member

This PR:

  • uses logger.info instead of warn when truncating long titles
  • when mne.viz.plot_compare_evokeds(..., picks='grad') (or any picks that is a single channel type), sets title to the channel type instead of listing out (and truncating) channel names.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 22, 2019

Codecov Report

Merging #6173 into master will increase coverage by <.01%.
The diff coverage is 25%.

@@            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

@drammock
Copy link
Copy Markdown
Member Author

@larsoner @massich ready for review

@drammock drammock changed the title better title in plot_compare_evokeds (closes #6165) MRG: better title in plot_compare_evokeds (closes #6165) Apr 22, 2019
@agramfort agramfort changed the title MRG: better title in plot_compare_evokeds (closes #6165) MRG+1: better title in plot_compare_evokeds (closes #6165) Apr 22, 2019

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:
Copy link
Copy Markdown
Contributor

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:

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

Otherwise I'm happy ..

@larsoner larsoner merged commit 52949f1 into mne-tools:master Apr 22, 2019
massich pushed a commit to massich/mne-python that referenced this pull request Apr 23, 2019
…ne-tools#6173)

* better title in plot_compare_evokeds (closes mne-tools#6165)

* use logger.info instead of warn

* fix stupidity

* simplify
@drammock drammock deleted the fix_plot_compare_evokeds_title branch April 24, 2019 05:13
jeythekey pushed a commit to jeythekey/mne-python that referenced this pull request Apr 27, 2019
…ne-tools#6173)

* better title in plot_compare_evokeds (closes mne-tools#6165)

* use logger.info instead of warn

* fix stupidity

* simplify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants