Repository navigation
Add EEGLAB-style cart2topo, pop_reref, and pop_interp parity workflows - #52
Conversation
|
Claude finished @suraj-ranganath's task in 4m 12s —— View job 🤖 ### Code review
Blocking
Important
Nits
Test gaps
EEGLAB parity notes
· Branch: |
|
@claude review this PR |
|
Claude finished @suraj-ranganath's task in 5m 2s —— View job Code review
Verifying the prior review thread against the current tip ( Previously blocking — all fixed
Previously important — all fixed
Previously nits — addressed
Remaining nits (non-blocking)
EEGLAB parity sanity-check
Nice cleanup pass — all of the prior blockers are resolved with regression coverage. The three nits above are non-blocking. · Branch: |
Visual parity screenshotsCaptured side-by-side UI parity screenshots for the user-facing paths covered by this PR. Left: EEGLAB reference. Right: EEGPrep current branch. These images are uploaded as PR review artifacts and are not committed to the PR branch. All covered UI componentsIndividual side-by-side captures
|
|
@claude review this |
|
Claude finished @suraj-ranganath's task in 4m 43s —— View job Code review
Verifying the prior review thread against the current tip ( Previously blocking — confirmed fixed
Previously important — confirmed fixed
New work since the prior reviewTwo notable additions beyond the prior review's scope:
Remaining nits (non-blocking)
EEGLAB parity sanity-check (re-run on tip)
Solid follow-up pass — every blocker from the prior review has a fix plus regression coverage, and the two new commits address real gaps rather than cosmetic ones. No new blockers. · Branch: |
|
Claude finished @suraj-ranganath's task in 2m 52s —— View job Code review
The only commit added since the last review is Re-verified on tip
|
| Prior concern | Status | Where |
|---|---|---|
_theta_radius returns radians via np.deg2rad |
✅ fixed + regression test | eeg_interp.py:281, tests/test_eeg_interp.py:23 |
pop_reref history channel indices are 1-based (incl. exclude/interpchan) |
✅ fixed | pop_reref.py:751-781 |
pop_interp history emits MATLAB-replayable [1 2 …] / EEG.chaninfo.removedchans([…]) / ALLEEG(N).chanlocs([…]) |
✅ fixed | qt.py:537-591, pop_interp.py:250-254 |
AGENTS.md import rules: project imports at top, PySide6 wrapped via _require_qt |
✅ fixed | qt.py:10-32, listdlg2.py:8-21, pophelp.py:17-23, pop_interp.py:12 |
Helpers de-duplicated into _chanutils.py (chanlocs_as_list, is_number_like, normalise_reflocs) |
✅ fixed | _chanutils.py |
Dead one_based_numbers kwarg removed |
✅ fixed | — |
Silent no-op options (addrefchannel, enforcetype) rejected; refica="backwardcomp" is a distinct branch |
✅ fixed | pop_reref.py:585-591 |
_eegprep_value replaced by Qt typed property |
✅ fixed | qt.py:597 |
pop_interp layout magic moved to DialogSpec.content_margins |
✅ fixed | pop_interp.py:180 |
| ICLABEL float32 rationale comment | ✅ fixed | tests/test_ICL_feature_extractor_parity.py:27-28 |
Dead weights = np.ones(...) init in _huber_average_reference |
✅ fixed | — |
keepref/refica history casing normalised |
✅ fixed | pop_reref._normalise_history_option_value |
pophelp no longer falls back to src/eegprep/eeglab/ |
✅ fixed | pophelp.py:72-82 raises FileNotFoundError for missing packaged resources |
_accept_if_valid GUI input validation (Huber threshold, channel labels, time range) |
✅ added with happy + error-path tests | qt.py:345-413, tests/test_gui_pop_reref.py:122, tests/test_pop_interp.py:189 |
_normalise_icachansind flattens to plain list[int] (numpy 0-d comparison fix) |
✅ fixed | pop_reref.py:600, pop_reref.py:659-662 |
| 0-based GUI numeric input documented for EEGLAB-muscle-memory users | ✅ added (cef42e1) |
quickstart.rst:340-345, pop_reref.md:20-22 |
Remaining nits (non-blocking, carry over from prior review)
These were already flagged as non-blocking last round; not requesting changes here, just keeping the trail visible.
_widget_checked/_widget_textstill usehasattrfor protocol checks (qt.py:459, 463). AGENTS.md flagshasattras an anti-pattern, though the canonical case it warns about is "old-vs-new attribute name"; this is closer to "is this a QWidget protocol member."isinstance(widget, qt_widgets.QCheckBox)would be stricter, but leaving as-is for a future cleanup is fine.- Three near-identical
_require_qt/optional-dep blocks acrossqt.py:26-32,listdlg2.py:15-21,pophelp.py:17-23. Pure cleanup — single shared helper inguifunc/_qt.pywould shrink the surface, but each duplicate is small and self-explanatory.
EEGLAB parity sanity-check
cart2topo: signs (-sph_theta), units (0.5 - sph_phi/180), and_wrap_degreesmatchcart2topo.mmethod-2 output.reref(average/keepref/exclude/huber) and ICA expansion via paddedreref— math looks right; theicachansindnormalization fix removes a real numpy-version-dependent comparison bug.pop_chanselquoting/escaping matches EEGLAB's whitespace-vs-cellstr branching.pop_interpdialogvalidate_numeric_rangemirrorspop_interp.m'sif min(timerange) < EEG.xmin || max(timerange) > EEG.xmaxwarning, withmath.floor(max(...))matching MATLABfloor()semantics.
Final pass — every prior blocker is fixed with regression coverage, the new commit closes the documentation gap, and the two remaining nits are explicitly non-blocking. No new blockers.
--- · Branch: ga/cart2topo-pop-reref
|
@claude can you do a PR review focusing on potential backward compatibility issues |
|
Claude finished @arnodelorme's task in 5m 43s —— View job Backward-compatibility review
Scope: focused review of behaviors that existing eegprep callers may depend on, comparing tip Bottom line: the public API is mostly additive, but Behavioral changes in
|












Summary
This PR adds EEGLAB-style support for
cart2topo,pop_reref, andpop_interp, with GUI and visual parity infrastructure for the affected workflows.What changed
cart2topoand exported it through the package API and Sphinx docs.rerefsupport and expandedpop_rerefto cover average/common reference paths,keepref,exclude,refloc,interpchan, Huber reference, multi-dataset GUI behavior, refica handling, and EEGLAB-style command history formatting.pop_interp,pop_chansel,listdlg2, andpophelpsupport to mirror EEGLAB GUI helper flows.pop_reref, andpop_interpparity captures.Why
EEGPrep aims to preserve EEGLAB concepts, file organization, command history, and user experience while using Python APIs internally. These changes fill the requested
cart2topoandpop_rereffunctionality and add supporting interpolation/channel-selection GUI flows needed for closer EEGLAB parity.Validation
./pre-commit.py --fix tests/test_ICL_feature_extractor_parity.pyuv run pytest tests/test_ICL_feature_extractor_parity.py -q->2 passeduv run pytest tests/test_visual_parity.py tests/test_pop_interp.py tests/test_gui_pop_reref.py tests/test_pop_reref.py tests/test_guifunc_pophelp_chansel.py -q->73 passeduv run pytest->1038 passed, 32 skipped, 44 warnings