Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file format check in _check_eeglab_fname function #12523

Merged
merged 5 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/devel/12523.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove FDT file format check for strings in EEGLAB's EEG.data in :func:`mne.io.read_raw_eeglab` and related functions by :newcontrib:`Seyed Yahya Shirazi`
2 changes: 2 additions & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -611,3 +611,5 @@
.. _Zhi Zhang: https://github.com/tczhangzhi/

.. _Zvi Baratz: https://github.com/ZviBaratz

.. _Seyed Yahya Shirazi: https://neuromechanist.github.io
2 changes: 0 additions & 2 deletions mne/io/eeglab/eeglab.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ def _check_eeglab_fname(fname, dataname):
"Old data format .dat detected. Please update your EEGLAB "
"version and resave the data in .fdt format"
)
elif fmt != ".fdt":
raise OSError("Expected .fdt file format. Found %s format" % fmt)
Comment on lines -55 to -56
Copy link
Member

Choose a reason for hiding this comment

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

If .fdt is standard, it's perhaps better to change this to a warn(...) rather than remove it entirely

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.


basedir = op.dirname(fname)
data_fname = op.join(basedir, dataname)
Expand Down
Loading