You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
eeg_interp takes 0-based channel indices while pop_interp takes 1-based #569
Follow-up from Stream 4 (#549, PR #560) and F70 (#550).
Problem.#560 made pop_interp use 1-based channel numbers, the way EEGLAB does. eeg_interp still treats integer channel indices as 0-based, so the same number points to different channels depending on which function you call.
Repro (on develop)
eeg_interp(EEG, [0]) interpolates channel 1.
pop_interp(EEG, [1]) also interpolates channel 1.
pop_interp(EEG, [0]) raises an error.
Done when
The convention is decided and applied consistently across the interpolation API, matching EEGLAB's 1-based eeg_interp unless Suraj or Arno decide otherwise.
Every internal caller is updated.
Out-of-range input raises a helpful error that names the valid 1-based range.
MATLAB EEGLAB reference run (required before merge; core function change)
Research
pop_interp converts 1-based indices to 0-based in _zero_based_channels and then calls eeg_interp, which uses sorted(bad_chans) directly as 0-based indices. EEGLAB's eeg_interp.m takes 1-based indices. No src caller other than pop_interp passes numeric indices (std_interp, eeg_getdatact, bids_preproc pass chanlocs).
#572: eeg_interp takes 1-based indices and raises eeg_interp: channel index N is outside 1..nbchan for indices outside that range. pop_interp no longer converts them. The parametrized test test_interp_channel_indices_are_one_based covers both functions. Breaking change for scripts that passed 0-based indices to eeg_interp; noted in changelog.
Activity
claude commentedon Nov 7, 2026
🤖 Plan:
agent/20261107-fix-569, failing tests firstpop_interpintoeeg_interp;pop_interppasses indices throughResearch
pop_interpconverts 1-based indices to 0-based in_zero_based_channelsand then callseeg_interp, which usessorted(bad_chans)directly as 0-based indices. EEGLAB'seeg_interp.mtakes 1-based indices. No src caller other thanpop_interppasses numeric indices (std_interp,eeg_getdatact,bids_preprocpass chanlocs).Relevant code
src/eegprep/functions/popfunc/eeg_interp.py#L109-L113- numeric indices used as 0-basedsrc/eegprep/functions/popfunc/pop_interp.py#L294-L317- 1-based validation/conversionFix
#572:
eeg_interptakes 1-based indices and raiseseeg_interp: channel index N is outside 1..nbchanfor indices outside that range.pop_interpno longer converts them. The parametrized testtest_interp_channel_indices_are_one_basedcovers both functions. Breaking change for scripts that passed 0-based indices toeeg_interp; noted in changelog.Use 1-based channel indices in eeg_interp
arnodelorme commentedon Dec 1, 2026
🤖 The pop_interp dialog and native jamming captures are tracked in #935.