Conversation
Deepnar
requested review from
agramfort,
drammock and
larsoner
as code owners
September 9, 2026 11:14
|
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
CarinaFo
requested changes
Sep 17, 2026
CarinaFo
left a comment
Contributor
There was a problem hiding this comment.
Looks good, some small nitpicks.
We can use _pl from mne.utils to use the singular/plural of channel depending on length of bad channels.
Thank you for your contribution.
| that to aid in interpolation rather than completely discarding the | ||
| data from the two channels. | ||
|
|
||
| Channels listed in ``inst.info["bads"]`` are ignored for exclusion and |
Contributor
There was a problem hiding this comment.
Suggested change
| Channels listed in ``inst.info["bads"]`` are ignored for exclusion and | |
| Channels listed in ``inst.info["bads"]`` are not excluded and |
| from ..io import BaseRaw, RawArray | ||
| from ..transforms import _cart_to_sph, _sph_to_cart | ||
| from ..utils import _ensure_int, _validate_type | ||
| from ..utils import _ensure_int, _validate_type, warn |
Contributor
There was a problem hiding this comment.
Suggested change
| from ..utils import _ensure_int, _validate_type, warn | |
| from ..utils import _ensure_int, _pl, _validate_type, warn |
| bads_orig = inst.info["bads"] | ||
| if bads_orig: | ||
| warn( | ||
| f"The channels {', '.join(bads_orig)} are marked as bad but will not " |
Contributor
There was a problem hiding this comment.
Suggested change
| f"The channels {', '.join(bads_orig)} are marked as bad but will not " | |
| f"The channel{_pl(bads_orig)} marked as bad will not " |
- Import _pl from mne.utils
- Docstring: 'are ignored for exclusion and' -> 'are not excluded and'
- Warning: follow Carina's suggestion literally:
f"The channel{_pl(bads_orig)} marked as bad will not "
(removes channel list, uses _pl for singular/plural)
- Update test to match generic warning
Deepnar
force-pushed
the
fix/14263-warn-bridged-bads
branch
from
September 17, 2026 12:57
e0f5358 to
e7f7d7d
Compare
CarinaFo
approved these changes
Sep 20, 2026
CarinaFo
left a comment
Contributor
There was a problem hiding this comment.
looks good, thanks again for your contribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
interpolate_bridged_electrodestemporarily clearsinst.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
inst.info["bads"]is non-empty.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 skippedgit diff --checkpassedCloses #14263.