Skip to content

MRG: Better shape checks for SourceEstimate - #5973

Merged
agramfort merged 5 commits into
mne-tools:masterfrom
larsoner:check-stc
Feb 21, 2019
Merged

agramfort merged 5 commits into
mne-tools:masterfrom
larsoner:check-stc

Conversation

@larsoner

Copy link
Copy Markdown
Member

I've run into tricky problems accidentally passing vector data (n, 3, t) to SourceEstimate. This implements data size checks for our classes.

@larsoner

Copy link
Copy Markdown
Member Author

Argh this exposes a problem where VolSourceEstimate does not have a Vector type, but should. I guess I'll add it. We are getting quite a few *SourceEstimate types.

@codecov

codecov Bot commented Feb 20, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #5973 into master will increase coverage by 0.11%.
The diff coverage is 94%.

@@            Coverage Diff             @@
##           master    #5973      +/-   ##
==========================================
+ Coverage   88.71%   88.83%   +0.11%     
==========================================
  Files         401      401              
  Lines       72754    72839      +85     
  Branches    12162    12172      +10     
==========================================
+ Hits        64542    64704     +162     
+ Misses       5272     5214      -58     
+ Partials     2940     2921      -19

Comment thread mne/tests/test_source_estimate.py Resolved
Comment thread mne/source_estimate.py Resolved
Comment thread mne/source_estimate.py
return self.vertices

@verbose
def save(self, fname, ftype='h5', verbose=None):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does it mean we write to hdf5 by default also for surface SourceEstimates with this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, SourceEstimate overrides this and only calls super if they request h5

@agramfort

agramfort commented Feb 20, 2019 via email

Copy link
Copy Markdown
Member

@larsoner

Copy link
Copy Markdown
Member Author

Renaming complete

@agramfort
agramfort merged commit 7c21bd6 into mne-tools:master Feb 21, 2019
@agramfort

Copy link
Copy Markdown
Member

thx @larsoner

@larsoner
larsoner deleted the check-stc branch February 21, 2019 12:19
jeythekey pushed a commit to jeythekey/mne-python that referenced this pull request Apr 27, 2019
* BUG: Better shape checks for SourceEstimate

* ENH: Add VolVectorSourceEstimate

* STY: Rename

* FIX: Missed one

* STY: docstyle
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.

2 participants