Skip to content

Reduce Expected .fdt file format error to warning #12500

@neuromechanist

Description

@neuromechanist

Description of the problem

In uncommon (usually stemming from custom code) cases where EEG.data is a string but does not point to the FDT file, this error prevents the user from loading the data:

raise OSError("Expected .fdt file format. Found %s format" % fmt)

Since the following lines deal with the case of data_fname not being found, I suggest converting this error to a warning. EEGLAB also has a similar behavior, which falls back to searching the directory for the FDT file if the EEG.data string does not point to the FDT.

Steps to reproduce

datafile = './sub-002_task-FacePerception_run-1_eeg_ON.set'
EEG = mne.io.read_raw_eeglab(datafile, preload=True)

Link to data

https://drive.google.com/drive/folders/18y0TALqwT4Z2yg4T6QafDAqIrY04jI5k?usp=sharing

Expected results

EEG will point to the data object.

Actual results

OSError: Expected .fdt file format. Found format

Additional information

Platform             macOS-14.4-arm64-arm-64bit
Python               3.10.13 (main, Sep 11 2023, 08:24:56) [Clang 14.0.6 ]
Executable           [/opt/homebrew/anaconda3/envs/torch-sci/bin/python](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/torch-sci/bin/python)
CPU                  arm (8 cores)
Memory               16.0 GB

Core
├☑ mne               1.6.1 (latest release)
├☑ numpy             1.26.3 (OpenBLAS 0.3.21 with 8 threads)
├☑ scipy             1.11.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions