Skip to content

FIX: Warn when bridged interpolation uses bad channels - #14287

Open
Deepnar wants to merge 1 commit into
mne-tools:mainfrom
Deepnar:fix/14263-warn-bridged-bads
Open

FIX: Warn when bridged interpolation uses bad channels#14287
Deepnar wants to merge 1 commit into
mne-tools:mainfrom
Deepnar:fix/14263-warn-bridged-bads

Conversation

@Deepnar

@Deepnar Deepnar commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

interpolate_bridged_electrodes temporarily clears inst.info["bads"] while building the interpolation. This can allow channels already marked bad to influence the result without notifying the caller.

This patch keeps the existing interpolation behavior and public API unchanged, but emits a warning naming the affected channels and documents the behavior.

Changes

  • Warn when inst.info["bads"] is non-empty.
  • Document the behavior in the public docstring.
  • Extend the existing regression test to check the warning and restoration of the original bad-channel list.
  • Add a bugfix changelog fragment.

Testing

  • .venv/bin/python -m pytest -p no:pytest-qt mne/preprocessing/tests/test_interpolate.py::test_interpolate_bridged_electrodes --verbose — 1 passed
  • .venv/bin/python -m pytest -p no:pytest-qt mne/preprocessing/tests/test_interpolate.py --verbose — 11 passed
  • .venv/bin/python -m pytest -p no:pytest-qt mne/tests/test_docstring_parameters.py --verbose — 17 passed, 2 skipped
  • Ruff check and format check passed
  • Codespell passed
  • git diff --check passed

Closes #14263.

@welcome

welcome Bot commented Sep 9, 2026

Copy link
Copy Markdown

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Interpolate bridged electrodes silently interpolates using bads

1 participant