alexenge / hu-neuro-pipeline

Single trial EEG pipeline at the Abdel Rahman Lab for Neurocognitive Psychology, Humboldt-Universität zu Berlin
https://hu-neuro-pipeline.readthedocs.io
MIT License
14 stars 3 forks source link

MNE 1.5 has re-introduced the error when providing non-existing triggers #148

Open alexenge opened 9 months ago

alexenge commented 9 months ago

See #88 for the original issue and fix

The change on this line (for combining channels, used when computing the single trial amplitudes) is the culprit:

https://github.com/mne-tools/mne-python/blame/77328c09b8f709bee2c702d66cc8935fcf8c83d5/mne/channels/channels.py#L1894

We could avoid using combine_channels and instead average across channels with Numpy. Or file an issue over at MNE that highlights this.

alexenge commented 8 months ago

Additional non-existing triggers also produce an error when trying to create HTML reports (with reports_dir):

Traceback (most recent call last):
  File "<string>", line 5, in <module>
  File "/Users/alexander/Code/hu-neuro-pipeline/scratch/../pipeline/report.py", line 46, in create_report
    report.add_events(
  File "/Users/alexander/mambaforge/envs/hu-neuro-pipeline-docs/lib/python3.11/site-packages/mne/report/report.py", line 1592, in add_events
    self._add_events(
  File "/Users/alexander/mambaforge/envs/hu-neuro-pipeline-docs/lib/python3.11/site-packages/mne/report/report.py", line 3763, in _add_events
    fig = plot_events(
          ^^^^^^^^^^^^
  File "<decorator-gen-161>", line 12, in plot_events
  File "/Users/alexander/mambaforge/envs/hu-neuro-pipeline-docs/lib/python3.11/site-packages/mne/viz/misc.py", line 823, in plot_events
    _on_missing(on_missing, msg)
  File "/Users/alexander/mambaforge/envs/hu-neuro-pipeline-docs/lib/python3.11/site-packages/mne/utils/check.py", line 1142, in _on_missing
    raise error_klass(msg)
ValueError: 581 from event_id is not present in events.