You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
";" are not supported in EDF annotation descriptions #7287
Hi, I'm currently reading in an EDF file w/ the latest MNE dev version. read_raw_edf, and I encounter this error:
"ValueError: Semicolons in descriptions not supported."
I took a look at the descriptions for each annotation inside the EDF file using edfbrowser, and I see semicolons, but at the same time I don't quite understand why this is a problem? Is it possible to submit a PR that gets rid of this check if it is not necessary?
I can submit a PR if this is something we can fix.
Steps to reproduce
Create EDF file with annotation with a ";" in description.
Use read_raw_edf to read in file
Expected results
Some specific error text, specifying how we can fix this?
Or just no error at all.
Actual results
"ValueError: Semicolons in descriptions not supported."
for a reduced file that will not read because ";" are in annotation descriptions. I took a look at the source code, and:
from mne.annotations.py
def _check_o_d_s(onset, duration, description):
...
description = np.array(description, dtype=str)
if description.ndim == 0 or description.shape == (1,):
description = np.repeat(description, len(onset))
if description.ndim != 1:
raise ValueError('Description must be a one dimensional array, '
'got %d.' % (description.ndim,))
if any([';' in desc for desc in description]):
raise ValueError('Semicolons in descriptions not supported.')
is causing the error. I don't see why, we possibly can't take out that value error, or do a string replacement w/ say "-", or "|" to denote separation if really necessary?
Activity
agramfort commentedon Feb 4, 2020
adam2392 commentedon Feb 4, 2020
Will try trimming a file and posting a dropbox link here.
adam2392 commentedon Feb 4, 2020
https://www.dropbox.com/s/f3cg7xme8x3a0ui/SEEG_SZ_1P_0001_reduced_reduced.edf?dl=0
for a reduced file that will not read because ";" are in annotation descriptions. I took a look at the source code, and:
from
mne.annotations.pyis causing the error. I don't see why, we possibly can't take out that value error, or do a string replacement w/ say "-", or "|" to denote separation if really necessary?