Fix file format check in _check_eeglab_fname function#12523
Fix file format check in _check_eeglab_fname function#12523larsoner merged 5 commits intomne-tools:mainfrom
Conversation
|
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
larsoner
left a comment
There was a problem hiding this comment.
Does this also implement the suggestion:
That said, checking for the presence of an .fdt with the same base filename as the .set does seem sensible / fairly safe, so if you're up for making a pull request I don't really object to adding that behavior.
Or no?
| elif fmt != ".fdt": | ||
| raise OSError("Expected .fdt file format. Found %s format" % fmt) |
There was a problem hiding this comment.
If .fdt is standard, it's perhaps better to change this to a warn(...) rather than remove it entirely
There was a problem hiding this comment.
Yes, .fdt is the standard when the data is not included in the EEG structure.
However there is a warning already in place a few lines down (line 69) if the .fdt file is not found, which already covers 1) there is no .fdt file, or 2) the .fdt file name is incorrect.
So, I did not add another warning to avoid issuing double warnings for a single issue.
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
I believe this has been already addressed in the current implementation (Lines56-70) |
The lines you're linking to don't show up in the "files changed" tab of this pull request. |
Yes, I could not link to these lines in the blame because they have not changed. They are just below the changed (deleted) lines. |
ah, ok sorry! I was confused because you linked to the lines in your fork not in current main, so I (wrongly) thought you were saying "I already implemented this here". I didn't realize that was in |
|
@drammock, yes, that is precisely the case. Sorry for the confusion. |
|
by the way, you can "expand down" the diff of any files you changed (using the down-arrow button below the line numbers), and then link to unchanged lines. like this: https://github.com/mne-tools/mne-python/pull/12523/files#diff-9757a570dcb234f7b79ea08fa0145a3376617094785146136095147b32f0dd45L64-L68 (note that the URL ends with |
|
🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪 |
|
Thanks @neuromechanist ! |
* upstream/main: (50 commits) ENH: Improve OPM auditory dataset and example (mne-tools#12539) MAINT: Bump to latest pydata-sphinx-theme (mne-tools#12228) MRG: Simplify manual installation instructions a little by dropping explicit mention of (lib)mamba (mne-tools#12362) fix PSD weights handling when bad annotations present (mne-tools#12538) Fix phase loading (mne-tools#12537) align FFT windows to good data spans in psd_array_welch (mne-tools#12536) explicitly disallow multitaper in presence of bad annotations (mne-tools#12535) MAINT: Clean up PyVista contexts (mne-tools#12533) MAINT: Complete API change of ordered (mne-tools#12534) MAINT: Reinstall statsmodels and improve logging (mne-tools#12532) MAINT: Remove scipy.signal.morlet2 (mne-tools#12531) Update README badge links (mne-tools#12529) BUG: Fix bug with reading his_id from snirf (mne-tools#12526) [pre-commit.ci] pre-commit autoupdate (mne-tools#12524) Fix file format check in _check_eeglab_fname function (mne-tools#12523) MAINT: Reenable picard in pre testing (mne-tools#12525) MAINT: Bump to large resource class (mne-tools#12522) MAINT: Restore 2 jobs on Windows (mne-tools#12520) Add exclude_after_unique option to mne.io.read_raw_edf/read_raw_edf to search for exclude channels after making channel names unique (mne-tools#12518) Improve consistency of sensor types in code and documentation (mne-tools#12509) ...
Fixes #12500
Following the conversation in the issue, it seems that the explicit check for the
.fdtand raising error is not necessary.By removing the Error condition, the method will look for a
.fdtfile in the directory if it does not find it in theEEG.datafield while issuing a warning. This is also the expected and observed behavior in EEGLAB.I have tested the behavior with the GDrive file shared in the issue, which has stemmed from OpenNeuro dataset ds003645.
CC: @arnodelorme
Thanks.