Repository navigation
Implement EEGLAB-style interpolation in Reference for matlab_strict - #96
Conversation
|
Note: if the docstring for |
Codecov Report
@@ Coverage Diff @@
## master #96 +/- ##
==========================================
+ Coverage 98.83% 99.04% +0.21%
==========================================
Files 7 7
Lines 687 736 +49
==========================================
+ Hits 679 729 +50
+ Misses 8 7 -1
Continue to review full report at Codecov.
|
sappelhoff
left a comment
There was a problem hiding this comment.
Thanks! Nice to see all the equivalence tests :-)
One more general comments about the EEGLAB "translation" to Python --> i'd appreciate if you could go to the EEGLAB GitHub repo and create "permanent links" to the parts of the codebase that you used for the translation.
For example, you have these two lines of code:
# Subtract all the Euclidian electrode distances from 1 (why?)
EI = np.ones([n_to, n_from]) - elec_distsThis would be significantly enhanced (from a dev/docs perspective) if you add one more comment line like this (note, that's just an example):
# https://github.com/sccn/eeglab/blob/167dfc8766a253619fc586848c704665e39bce9f/Contents.m#L8You can also shorten the hash to 7 characters, instead of using the full hash:
https://github.com/sccn/eeglab/blob/167dfc8/Contents.m#L8
Do you mean per function, or per individual chunk of code (e.g. the |
I don't have a system in mind, so I'd leave this up to you and recommend to do it in a "reasonable way". For example if you take something from one file in EEGLAB, then put a link ... if the file you draw from changes further down your code, put in a new link. The readers can then be expected to follow your link and pick up the pieces themselves. that is: not every line of code must be mapped 👍 |
Okay, I put line references to the definitions of the functions I reimplemented. Hopefully that's enough for anyone curious in the future! |
) * Add initial implementation of EEGLAB interpolation * Update matlab_differences.rst * Add basic MATLAB comparison tests * Fix spelling mistake * Update whats_new.rst * Make isort happy * Improve wording around matlab_strict parameter * Fix Perrin citation RST * Add explicit refs to reimplemented EEGLAB code * Add references header in matlab_differences
|
@a-hurst this question on MNE discourse sounds like you could answer it: https://mne.discourse.group/t/montage-setting-differences-in-mne-vs-eeglab/3695/2 |
PR Description
Closes #77. This PR basically reimplements most of EEGLAB's
eeg_interpmethod in Python so we can finally do MATLAB equivalence tests for the entirety of theReferenceclass (also added in this PR). This was... not easy to say the least, but it was necessary for the peace of mind that these MatPREP comparison CI tests allow (and also helped us identify a bunch of other small bugs/discrepancies along the way).This is also the last numeric difference from MatPREP I'm aware of other than adaptive line noise removal (and differences between EEGLAB's montage-importing code and MNE's which result in differences in RANSAC, but that's not exactly a PREP divergence as much as an EEGLAB/MNE one).
Anyway, I've tried my best to make sense of and comment/document the re-implemented EEGLAB logic, but there are still a few areas I don't fully understand. If you have any insights, please let me know!
Merge Checklist
closes #<issue-number>to automatically close an issue