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

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

Merged
merged 4 commits into from
Apr 22, 2019

Conversation

drammock
Copy link
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

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
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
@@ -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:
Copy link
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
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