Description of the problem
A filename such as "my_eeg.2023.test.edf" will raise an error.
Steps to reproduce
test = mne.ie.read_raw("my.file.name.edf")
Link to data
No response
Expected results
Should use the last extension and use the appropriate reader.
Actual results
ValueError Traceback (most recent call last)
Cell In[2], line 6
3 file_to_process = "../data/test_eegs/patient.name.24-05-2021 18.14.46.edf"
4 # Run the classifier, passing the name of the bucket, and the name of the key (i.e. filename).
5 # Offsets are returned as a json string. The key is "offsets".
----> 6 offsets = classify(file_to_process)
7 print(offsets)
File ~/Projects/company/project/src/classifier.py:66, in classify(filename)
62 model.summary()
64 file_to_process = filename
---> 66 raw_eeg = mne.io.read_raw(file_to_process, preload=True, encoding="latin1")
67 raw_eeg.resample(DESIRED_SAMPLE_FREQ, n_jobs=4)
68 filtered_eeg = raw_eeg.filter(l_freq=0.1, h_freq=10, picks=get_channels(raw_eeg))
File ~/Projects/company/project/src/mne/io/_read_raw.py:121, in read_raw(fname, preload, verbose, **kwargs)
119 kwargs["preload"] = preload
120 if ext not in readers:
--> 121 _read_unsupported(fname)
122 these_readers = list(readers[ext].values())
123 for reader in these_readers:
File ~/Projects/company/project/src/mne/io/_read_raw.py:41, in _read_unsupported(fname, **kwargs)
39 msg += f" Try reading a {suggest} file instead."
40 msg += " Consider using a dedicated reader function for more options."
---> 41 raise ValueError(msg)
ValueError: Unsupported file type (.name.24-05-2021 18.14.46.edf). Consider using a dedicated reader function for more options.
Additional information
Platform: Linux-5.10.0-21-amd64-x86_64-with-glibc2.31
Python: 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0]
Executable: /home/john/anaconda3/envs/company/bin/python
CPU: : 8 cores
Memory: 46.9 GB
mne: 1.4.dev0
numpy: 1.24.2 {OpenBLAS 0.3.21 with 8 threads}
scipy: 1.10.1
matplotlib: 3.7.0 {backend=Qt5Agg}
sklearn: 1.2.1
numba: Not found
nibabel: Not found
nilearn: Not found
dipy: Not found
openmeeg: Not found
cupy: Not found
pandas: 1.5.3
pyvista: Not found
pyvistaqt: Not found
ipyvtklink: Not found
vtk: Not found
qtpy: Not found
ipympl: Not found
pyqtgraph: Not found
pooch: v1.6.0
mne_bids: Not found
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: Not found
mne_connectivity: Not found
mne_icalabel: Not found
Description of the problem
A filename such as "my_eeg.2023.test.edf" will raise an error.
Steps to reproduce
Link to data
No response
Expected results
Should use the last extension and use the appropriate reader.
Actual results
ValueError Traceback (most recent call last)
Cell In[2], line 6
3 file_to_process = "../data/test_eegs/patient.name.24-05-2021 18.14.46.edf"
4 # Run the classifier, passing the name of the bucket, and the name of the key (i.e. filename).
5 # Offsets are returned as a json string. The key is "offsets".
----> 6 offsets = classify(file_to_process)
7 print(offsets)
File ~/Projects/company/project/src/classifier.py:66, in classify(filename)
62 model.summary()
64 file_to_process = filename
---> 66 raw_eeg = mne.io.read_raw(file_to_process, preload=True, encoding="latin1")
67 raw_eeg.resample(DESIRED_SAMPLE_FREQ, n_jobs=4)
68 filtered_eeg = raw_eeg.filter(l_freq=0.1, h_freq=10, picks=get_channels(raw_eeg))
File ~/Projects/company/project/src/mne/io/_read_raw.py:121, in read_raw(fname, preload, verbose, **kwargs)
119 kwargs["preload"] = preload
120 if ext not in readers:
--> 121 _read_unsupported(fname)
122 these_readers = list(readers[ext].values())
123 for reader in these_readers:
File ~/Projects/company/project/src/mne/io/_read_raw.py:41, in _read_unsupported(fname, **kwargs)
39 msg += f" Try reading a {suggest} file instead."
40 msg += " Consider using a dedicated reader function for more options."
---> 41 raise ValueError(msg)
ValueError: Unsupported file type (.name.24-05-2021 18.14.46.edf). Consider using a dedicated reader function for more options.
Additional information
Platform: Linux-5.10.0-21-amd64-x86_64-with-glibc2.31
Python: 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0]
Executable: /home/john/anaconda3/envs/company/bin/python
CPU: : 8 cores
Memory: 46.9 GB
mne: 1.4.dev0
numpy: 1.24.2 {OpenBLAS 0.3.21 with 8 threads}
scipy: 1.10.1
matplotlib: 3.7.0 {backend=Qt5Agg}
sklearn: 1.2.1
numba: Not found
nibabel: Not found
nilearn: Not found
dipy: Not found
openmeeg: Not found
cupy: Not found
pandas: 1.5.3
pyvista: Not found
pyvistaqt: Not found
ipyvtklink: Not found
vtk: Not found
qtpy: Not found
ipympl: Not found
pyqtgraph: Not found
pooch: v1.6.0
mne_bids: Not found
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: Not found
mne_connectivity: Not found
mne_icalabel: Not found