I'm trying to use the utils.split function to split a hyper-epoch into two single-participant epochs. However, after running this code:
epo1, epo2 = hypyp.utils.split(RawData)
I get the following error: "RuntimeError: events cannot be set directly.", referring to this line of the utils.split function code:
raws.info['events'] = raw_merge.info['events']
I've looked it up and it seems like the MNE Info structure sets the field 'events' to be read-only (https://github.com/mne-tools/mne-python/blob/main/mne/io/meas_info.py), so it makes sense that it would return this error. What am I missing here, am I using the utils.split function wrong? I would greatly appreciate your help with this, I've been stuck on this for a while now. Thank you!
Dear @Alicja,
Thanks for your message. It's indeed caused by a change in MNE handling of events.
Can you try with the new version of HyPyP? It should work now.
Guillaume
Dear HyPyP Team,
I'm trying to use the utils.split function to split a hyper-epoch into two single-participant epochs. However, after running this code:
epo1, epo2 = hypyp.utils.split(RawData)
I get the following error: "RuntimeError: events cannot be set directly.", referring to this line of the utils.split function code:
raws.info['events'] = raw_merge.info['events']
I've looked it up and it seems like the MNE Info structure sets the field 'events' to be read-only (https://github.com/mne-tools/mne-python/blob/main/mne/io/meas_info.py), so it makes sense that it would return this error. What am I missing here, am I using the utils.split function wrong? I would greatly appreciate your help with this, I've been stuck on this for a while now. Thank you!
Alicja