Repository navigation
[ENH] ensure simulate_sparse_stc throws error when n_dipoles > len(labels) - #5976
Merged
Merged
Conversation
agramfort
reviewed
Feb 21, 2019
agramfort
approved these changes
Feb 21, 2019
Member
|
@QB3 you'll need to make the PR mergeable not draft mode |
QB3
marked this pull request as ready for review
February 21, 2019 13:49
massich
approved these changes
Feb 21, 2019
larsoner
reviewed
Feb 21, 2019
| subjects_dir=subjects_dir) # no subject | ||
| pytest.raises(ValueError, simulate_sparse_stc, fwd['src'], len(labels), | ||
| times, labels=labels, location='foo') # bad location | ||
| pytest.raises(ValueError, simulate_sparse_stc, fwd['src'], len(labels) + 1, |
Member
There was a problem hiding this comment.
The modern/clearer way to do this is:
with pytest.raises(ValueError, match='some regex str'):
simulate_sparse_stc(...)
It's clearer and more precise.
Also there is a PEP8 error
Otherwise LGTM
agramfort
reviewed
Feb 21, 2019
|
|
||
| pytest.raises(ValueError, simulate_sparse_stc, fwd['src'], len(labels) + 1, | ||
| times, labels=labels, random_state=random_state, | ||
| location=location, subjects_dir=subjects_dir) |
Member
There was a problem hiding this comment.
this is not testes twice. @QB3 please remove this first one and only keep the with block
Codecov Report
@@ Coverage Diff @@
## master #5976 +/- ##
==========================================
+ Coverage 88.82% 88.83% +0.01%
==========================================
Files 401 401
Lines 72839 72871 +32
Branches 12172 12179 +7
==========================================
+ Hits 64702 64738 +36
+ Misses 5216 5215 -1
+ Partials 2921 2918 -3 |
agramfort
approved these changes
Feb 21, 2019
Member
|
PEP8: I recommend using an editor with built-in PEP8 notifications |
Contributor
Author
|
I fixed the pep8 error, it seems to pass the tests now :) |
jeythekey
pushed a commit
to jeythekey/mne-python
that referenced
this pull request
Apr 27, 2019
…ne-tools#5976) This PR ensures that `simulate_sparse_stc` throws an error when `n_dipoles > len(labels)` Fixes #5953r
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
simulate_sparse_stcthrows an assertion error whenn_dipoles > len(labels).It should generate
min(n_dipoles, len(labels))dipoles.Fixes #5953