Skip to content

MNT: refactor _make_stc#6636

Merged
massich merged 4 commits intomne-tools:masterfrom
massich:refactor_make_stc
Aug 7, 2019
Merged

MNT: refactor _make_stc#6636
massich merged 4 commits intomne-tools:masterfrom
massich:refactor_make_stc

Conversation

@massich
Copy link
Copy Markdown
Contributor

@massich massich commented Aug 6, 2019

This PR refactors _make_stc in order to simplify #6609

@massich
Copy link
Copy Markdown
Contributor Author

massich commented Aug 6, 2019

For now just runnint the CIs.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 6, 2019

Codecov Report

Merging #6636 into master will increase coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master   #6636      +/-   ##
=========================================
+ Coverage   89.38%   89.4%   +0.02%     
=========================================
  Files         416     416              
  Lines       75127   75130       +3     
  Branches    12352   12352              
=========================================
+ Hits        67150   67172      +22     
+ Misses       5141    5126      -15     
+ Partials     2836    2832       -4

@massich massich requested a review from wmvanvliet August 6, 2019 21:14
@massich
Copy link
Copy Markdown
Contributor Author

massich commented Aug 6, 2019

I thought I would also win something in terms of speed with the vectorization but that's not the case. test_make_inverse_operator_vector takes the same time with both implementations.

@massich massich marked this pull request as ready for review August 6, 2019 21:24
@massich
Copy link
Copy Markdown
Contributor Author

massich commented Aug 7, 2019

Travis errors are unrelated:

>               raise URLError(err)
3391E               urllib.error.URLError: <urlopen error timed out>

@massich massich merged commit 8705374 into mne-tools:master Aug 7, 2019
@massich massich deleted the refactor_make_stc branch August 7, 2019 09:41
@wmvanvliet
Copy link
Copy Markdown
Contributor

Great refactor! Looks much cleaner. Since you touched the rotation logic, did you double check that the vectors in the VectorSourceEstimate are rotated correctly?

@massich
Copy link
Copy Markdown
Contributor Author

massich commented Aug 8, 2019

@wmvanvliet yes. If you check the first commit bd2b703, I ran both computations, put assert and run the entire test suite. All green lights!

            xx = np.matmul(
                np.transpose(source_nn.reshape(n_vertices, 3, 3),
                             axes=[0, 2, 1]),
                data.reshape(n_vertices, 3, -1)
            )
            np.testing.assert_allclose(xx, data_rot)

alexrockhill pushed a commit to alexrockhill/mne-python that referenced this pull request Oct 1, 2019
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