Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexenge opened this issue Oct 20, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@alexenge
Copy link
Owner

alexenge commented Oct 20, 2023

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 alexenge added the bug Something isn't working label Oct 20, 2023
@alexenge
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant