Skip to content

Standalone MNE preprocessors: handle remaining cases from #885 #1055

Closed

Description

@adammounir

Follow-up to #1037, which safely fixed 3 of the 19 broken standalone-function preprocessors from #885 (the ones verified to return the modified instance: compute_current_source_density, set_bipolar_reference, oversampled_temporal_projection).

The remaining functions can not be fixed by simply passing the callable, because Preprocessor.apply would then replace the recording with whatever the function returns. They split into three buckets, each needing its own design:

1. Return auxiliary data (tuple/list/Annotations) — would corrupt the recording if passed as-is

  • annotate_amplitude -> (annotations, bads)
  • annotate_nan
  • compute_bridged_electrodes
  • find_bad_channels_lof -> list
  • standalone set_eeg_reference -> (raw, ref_data)
  • (and the other annotate_* / compute_* of the same kind)

These need a wrapper that calls the function and then re-applies its side effects to the recording (e.g. raw.set_annotations(...), raw.info['bads'] = ...).

2. Need a second instance / list input — don't fit the single-recording Preprocessor model

  • equalize_bads
  • equalize_channels
  • realign_raw

These require an API extension.

3. Operate on arrays

  • filter_data -> already documented to use Filter instead; candidate for deprecation rather than a fix.

Tracks the part of #885 not covered by #1037.

Activity

  1. added a commit that references this issue on Jun 18, 2026
  2. added a commit that references this issue on Jun 25, 2026
    7e4e2fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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