Iām having a problem with .edf files in the dataset ds002720 found in the OpenNeuro repository.
Iāve succeeded in working with other datasets, so I donāt know if the bug is in the dataset in the MNE library.
In the MNE GitHub account, Iāve found that you have to set the verbose to load the wrong channels.
Iāve done it, and Iām still getting an error, and I didnāt do any processing yet, just trying to read the raw data.
Iām sending a jupyter notebook with the error; Iāve used the tutorial jupyter notebook on the MNE site and just changed the dataset. read_bids_datasets
Thank you a lot, guys
Best regards
ValueError Traceback (most recent call last)
Untitled-4 in <module>
23 root=bids_root
24 )
----> 25 raw = mne_bids.read_raw_bids(bids_path=bids_path)
<decorator-gen-557> in read_raw_bids(bids_path, extra_params, verbose)
~/Development/mne-bids/mne_bids/read.py in read_raw_bids(bids_path, extra_params, verbose)
691 on_error='warn')
692 if events_fname is not None:
--> 693 raw = _handle_events_reading(events_fname, raw)
694
695 # Try to find an associated channels.tsv to get information about the
~/Development/mne-bids/mne_bids/read.py in _handle_events_reading(events_fname, raw)
400 if trial_type_col_name is not None:
401 # Drop events unrelated to a trial type
--> 402 events_dict = _drop(events_dict, 'n/a', trial_type_col_name)
403
404 if 'value' in events_dict:
~/Development/mne-bids/mne_bids/tsv_handler.py in _drop(data, values, column)
110 # FutureWarning, see
111 # https://github.com/mne-tools/mne-bids/pull/372
--> 112 values = np.array(values, dtype=new_data_col.dtype)
113
114 mask = np.in1d(new_data_col, values, invert=True)
ValueError: could not convert string to float: 'n/a'
the cause of the issue is that the *_events.tsv files in the dataset are empty (except for the column names). The BIDS spec isnāt clear on whether this is valid. In any case, MNE-BIDS doesnāt handle this situation gracefully.
Simply removing the *_events.tsv files fixes the issue.
btw another aspect that this dataset isnāt doing great is that apparently it encodes runs as ātasksā. May seem like a formality only, but itās clearly not how BIDS envisioned things to beā¦
Iāve gave you permission, to access the file.
And its the same āNaNā error that you reproduced.
Iāve noticed that they are using run as tasks, to work around this problem, Iāve settled up like :