I would like to follow in this issue. I am trying to use the built-in function for saving the spectrum data. But it failed because of the slash event annotations of men.
psd = epochs.compute_psd()
psd['go'].save('psd.hdf5', overwrite=True)
And here the full error
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[19], [line 2](vscode-notebook-cell:?execution_count=19&line=2) [1](vscode-notebook-cell:?execution_count=19&line=1) psd = epochs.compute_psd() ----> [2](vscode-notebook-cell:?execution_count=19&line=2) psd['go'].save('psd.hdf5', overwrite=True) File <decorator-gen-156>:12, in save(self, fname, overwrite, verbose) File /opt/anaconda3/envs/EEG/lib/python3.11/site-packages/mne/time_frequency/spectrum.py:947, in BaseSpectrum.save(self, fname, overwrite, verbose) [945](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/mne/time_frequency/spectrum.py:945) fname = _check_fname(fname, overwrite=overwrite, verbose=verbose) [946](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/mne/time_frequency/spectrum.py:946) out = self.__getstate__() --> [947](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/mne/time_frequency/spectrum.py:947) write_hdf5(fname, out, overwrite=overwrite, title="mnepython") File /opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:173, in write_hdf5(fname, data, overwrite, compression, title, slash, use_json, use_state) [171](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:171) else: [172](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:172) with h5py.File(fname, mode=mode) as fid: --> [173](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:173) _write(fid, cleanup_data) [175](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:175) # Will not be empty if any extra data to be written [176](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:176) for data in cleanup_data: [177](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:177) # In case different extra I/O needs different inputs File /opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:155, in write_hdf5.<locals>._write(fid, cleanup_data) [153](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:153) if title in fid: [154](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:154) del fid[title] --> [155](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:155) _triage_write( [156](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:156) title, [157](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:157) data, [158](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:158) fid, [159](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:159) comp_kw, [160](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:160) str(type(data)), [161](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:161) cleanup_data, [162](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:162) slash=slash, [163](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:163) title=title, [164](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:164) use_json=use_json, [165](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:165) use_state=use_state, [166](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:166) ) File /opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:221, in _triage_write(key, value, root, comp_kw, where, cleanup_data, slash, title, use_json, use_state) [219](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:219) if not isinstance(key, str): [220](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:220) raise TypeError("All dict keys must be strings") --> [221](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:221) _triage_write( [222](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:222) "key_{0}".format(key), [223](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:223) sub_value, [224](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:224) sub_root, [225](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:225) comp_kw,
...
[202](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:202) elif slash == "replace": [203](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:203) # Auto-replace keys with proper values [204](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/envs/EEG/lib/python3.11/site-packages/h5io/_h5io.py:204) for key_spec, val_spec in special_chars.items():
ValueError: Found a key with "/", this is not allowed if slash == error
This is how my events look:
go/correct/onoff1