Skip to content

Should missing event in one file crash the pipeline? #1222

@dnacombo

Description

@dnacombo

Hi,
Dealing with a large dataset where some conditions are missing in some files. However, running the pipeline today, I get the following error:

A critical error occurred. The error message was: KeyError: 'Event name "Stimulus/CatOld/Miss" could not be found. The following events are present in the data: New Segment/, Response/Resp1New, Response/Resp1Old, Response/Resp2No, Response/Resp2Yes, Stimulus/CatNewRepeated, Stimulus/CatNewUnique, Stimulus/CatOld, Stimulus/Fixation, Stimulus/ScreenResp1, Stimulus/ScreenResp2, Stimulus/StimNew, Stimulus/StimOld'

Aborting pipeline run. The traceback is:

  File "/network/iss/cenir/analyse/meeg/LIBERATE/03_scripts/EEG_wholecohort_py/mne-bids-pipeline/mne_bids_pipeline/steps/preprocessing/_07_make_epochs.py", line 122, in run_epochs
    epochs = make_epochs(
             ^^^^^^^^^^^^
  File "/network/iss/cenir/analyse/meeg/LIBERATE/03_scripts/EEG_wholecohort_py/mne-bids-pipeline/mne_bids_pipeline/_import_data.py", line 84, in make_epochs
    row_event_names = mne.event.match_event_names(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/network/iss/cenir/analyse/meeg/LIBERATE/03_scripts/EEG_wholecohort_py/mne-python/mne/event.py", line 1651, in match_event_names
    _on_missing(
  File "/network/iss/cenir/analyse/meeg/LIBERATE/03_scripts/EEG_wholecohort_py/mne-python/mne/utils/check.py", line 1222, in _on_missing
    raise error_klass(msg)
KeyError: 'Event name "Stimulus/CatOld/Miss" could not be found. The following events are present in the data: New Segment/, Response/Resp1New, Response/Resp1Old, Response/Resp2No, Response/Resp2Yes, Stimulus/CatNewRepeated, Stimulus/CatNewUnique, Stimulus/CatOld, Stimulus/Fixation, Stimulus/ScreenResp1, Stimulus/ScreenResp2, Stimulus/StimNew, Stimulus/StimOld'

Sounds like a good intention to prevent unbalanced conditions or missing files, but is there any way to bypass this?
Many thanks,
Max

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions