Skip to content

Conversation

@jona-sassenhagen
Copy link
Contributor

@jona-sassenhagen jona-sassenhagen commented May 5, 2019

Closes #6268

I am getting approx. half a second speedup for the tests on my machine.

Note I changed the functionality of plot_compare_evokeds a bit: now, as the doctstring already said, it will skip the CI if any condition has fewer than 2 evokeds.

@mmagnuski

jasmainak and others added 5 commits December 11, 2015 14:51
* 'master' of git://github.com/mne-tools/mne-python: (48 commits)
  Update brainvision.py
  FIX: bv read vmrks NaN duration
  FIX: Fix for new numpy
  FIX: Minor fixes
  Updated test.
  Bug fix
  misc
  FIX: Fix docs
  FIX: Fix docstring
  FIX: Fix rendering [ci skip]
  Address comments
  Update whats_new
  sfreq and whats new
  ADD v2 hdr/mrk
  ENH header check, default event_id=None
  ADD event_id arg
  ENH helper function for version
  ENH add channel position via montage
  FIX potential fix to scaling issue
  ENH support v2.0
  ...
@jona-sassenhagen jona-sassenhagen requested a review from mmagnuski May 5, 2019 12:32
@codecov
Copy link

codecov bot commented May 5, 2019

Codecov Report

Merging #6270 into master will increase coverage by <.01%.
The diff coverage is 84.61%.

@@            Coverage Diff             @@
##           master    #6270      +/-   ##
==========================================
+ Coverage   89.37%   89.38%   +<.01%     
==========================================
  Files         416      416              
  Lines       74975    74983       +8     
  Branches    12328    12329       +1     
==========================================
+ Hits        67007    67020      +13     
+ Misses       5133     5129       -4     
+ Partials     2835     2834       -1

@jona-sassenhagen
Copy link
Contributor Author

jona-sassenhagen commented May 5, 2019

I also added this to plot_compare_evoked with axes='topo'. This speeds up the plot by a lot, e.g. 4fold for 30 channels! Not much for tests though.

Edit: seems I am getting half a second on the tests here too.

@lgtm-com
Copy link

lgtm-com bot commented May 5, 2019

This pull request introduces 1 alert when merging 8c857cc into 14a0f19 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

Comment posted by LGTM.com

@jona-sassenhagen jona-sassenhagen changed the title Default ica.plot_properties to a parametric CI MRG Default ica.plot_properties to a parametric CI May 6, 2019
@mmagnuski
Copy link
Member

Looks good. How are the shades drawn for the psd? It's a different function for that, right?

@jona-sassenhagen
Copy link
Contributor Author

Yeah and I think you wrote it :D

@mmagnuski
Copy link
Member

That's right :) I was just trying to check whether psd stds were not refactored to be drawn via plot_compare_evokeds. I made sure by looking at the code now.
Then I don't have any other questions, LGTM. :)

@mmagnuski
Copy link
Member

Travis and Azure complain.

@jona-sassenhagen
Copy link
Contributor Author

Done I think

standard deviation above/below.
For the ERP/ERF, by default, plot the 95 percent parametric confidence
interval is calculated. To change this, use ``ci`` in ``ts_args`` in
``image_args`` (see below).
Copy link
Member

Choose a reason for hiding this comment

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

why is this called ci at some place and std at others? When I read plot_std for me you report +/- 1 standard deviation on the plots. This needs to be made consistent.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, for psd plot we first used +/-1 std but later when evoked plot was refactored to use plot_compare_evokeds it used 95% CI. So currently spectrum uses +/- 1 std and evoked plot uses CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure what would be best. The evoked reuses plot_compare_evokeds. We could use the one-sided CI functionality in both evoked and psd (and add it to `mne.stats._ci´), and call it a 95% CI for both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@agramfort
Copy link
Member

agramfort commented May 12, 2019 via email

@agramfort
Copy link
Member

my suggestions are not clear @jona-sassenhagen ?

@agramfort
Copy link
Member

agramfort commented May 12, 2019 via email

@larsoner larsoner added this to the 0.18 milestone May 13, 2019
@larsoner
Copy link
Member

@jona-sassenhagen do you think we can sort this out in the next couple of days to get it in for 0.18, or should we move the milestone to 0.19?

@jona-sassenhagen
Copy link
Contributor Author

The brainvision reader is IMO more important than this one, so I don't mind moving this to .19.

@larsoner larsoner modified the milestones: 0.18, 0.19 May 14, 2019
@agramfort
Copy link
Member

what's left to do here @jona-sassenhagen ?

@jona-sassenhagen
Copy link
Contributor Author

i'd like to wait for #6422.

@jona-sassenhagen
Copy link
Contributor Author

##[section]Starting: Run tests
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.151.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
pytest -m "not ultraslowtest" mne
========================== Starting Command Output ===========================
##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\02d3479f-eba7-4944-9140-065b5e3d239c.cmd""
'pytest' is not recognized as an internal or external command,
operable program or batch file.
##[error]Cmd.exe exited with code '1'.
##[section]Finishing: Run tests

What?

@mmagnuski
Copy link
Member

I don't know if this is related but Azure here seems to have the same problem during installation as in this other PR, see here.
There it seems that fixing CONDA_VERSION to 4.7.5 in azure-pipelines.yml helped.

@GuillaumeFavelier
Copy link
Contributor

I looked at the failing Windows Python37-64bit-full-conda build and at the end of the log of Install dependencies with conda, I see that you encounter the same error message as me:

LinkError: post-link script failed for package defaults::ipykernel-5.1.1-py37h39e3cac_0
location of failed script: D:\a\1\s\conda\Scripts\.ipykernel-post-link.bat
==> script messages <==
<None>
==> script output <==
stdout: 
stderr: '"D:\a\1\s\conda\condabin\conda.bat"' is not recognized as an internal or external command,

operable program or batch file.


return code: 1

()

@larsoner
Copy link
Member

@jona-sassenhagen rebase and Azure should be okay. But we can also ignore it and trust Travis for this if you want

@jona-sassenhagen
Copy link
Contributor Author

Rebase fixed this.

Further comments @drammock @agramfort @mmagnuski ?

@drammock
Copy link
Member

code looks reasonable. I agree with @agramfort's point about ci vs std --- it would be good to unify handling of confidence bands. But (unless I'm missing something) I don't see that as a blocker for this PR.

@agramfort agramfort merged commit f39331c into mne-tools:master Jul 26, 2019
@agramfort
Copy link
Member

thx @jona-sassenhagen

alexrockhill pushed a commit to alexrockhill/mne-python that referenced this pull request Oct 1, 2019
* FIX to account for different versions of sphinx_gallery

* FIX address comments

* FIX : always return array in pick_types

* FIX: Fix type

* init

* ...

* fix docstring

* ...

* also for plot_compare_evokeds topomode

* ..

* fix test and docstrong

* fixes

* make tests green

* pep8
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.

ENH: speed up ica.plot_properties

7 participants