Skip to content

Decompose BIDS Qt and FIR ownership - #216

Merged
suraj-ranganath merged 1 commit into
feature/fable5-architecture-closeoutfrom
phase/212-bids-qt-fir-ownership
Jun 12, 2026
Merged

suraj-ranganath merged 1 commit into
feature/fable5-architecture-closeoutfrom
phase/212-bids-qt-fir-ownership

Conversation

@suraj-ranganath

Copy link
Copy Markdown
Member

Moves BIDS raw loading and montage inference out of pop_load_frombids, shifts clean_rawdata FIR design helpers into firfilt ownership, and moves Qt renderer stateless helper implementations to module-level functions while preserving QtDialogRenderer helper aliases. Adds focused helper tests and keeps wrapper behavior unchanged.

Fixes #212

Part of #207

@claude

claude Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @suraj-ranganath's task in 4m 3s —— View job


Code review

  • Overall assessment: Looks good — clean, behavior-preserving decomposition.
  • Highest-risk area: Fidelity of the moved code (BIDS raw/montage helpers, FIR design helpers, Qt static helpers).
  • Merge recommendation: Safe to merge.

This PR is a pure ownership decomposition. I verified each move is faithful rather than just plausible:

FIR ownership — design_fir / design_kaiser moved from clean_rawdata/private/sigproc.py to the new firfilt/design.py. Logic is byte-identical (only N→n_points and f→response renames). All three consumers (clean_channels.py, clean_channels_nolocs.py, clean_drifts.py) re-point to firfilt.design, the lazy export is registered in firfilt/__init__.py, and no stale sigproc import design_* references remain anywhere in src/ or tests/. moving_average was correctly added to sigproc.__all__ (it's pre-existing at sigproc.py:49).

BIDS decomposition — load_raw_eeg_file and apply_montage_inference moved to EEG_BIDS/raw.py and EEG_BIDS/montage.py. Branches, defaults, scaling/ScaleApplied logic, montage scoring thresholds, the 10-5→10-20 labelscheme rule, coordinate transforms, and EEG-dict construction (chanlocs/nbchan/srate/event/urevent) all carried over unchanged. pop_load_frombids.py:128 and :593 call the new functions with matching signatures and correct unpacking; the 1-based latency comment is preserved.

Qt helpers — 45 already-@staticmethod helpers moved to module level and re-attached via staticmethod aliases. None referenced self; the two genuinely stateful methods (_run_tf_cycle_calc, _connect_callback) correctly stayed as instance methods. Both call forms (self._helper(...) internally, QtDialogRenderer._helper(...) in tests) continue to work.

Blocking

None.

Important

None.

Nits

  • firfilt/design.py: the moved design_fir / design_kaiser docstrings were trimmed from full Parameters/Returns sections to one-liners. These are now the canonical owners of these helpers, so the richer docstrings would have been worth keeping. Non-blocking.

Test gaps

None. Parity tests in test_clean_rawdata.py (against EEGLAB design_kaiser/design_fir) are preserved with re-pointed imports; new ownership tests (test_firfilt_helpers.py, test_gui_pop_firfilt.py) assert module ownership/alias identity; test_bids_load_frombids_helpers.py exercises real branches (.set loader dtype/srate, montage 10-5→10-20 rule, finite-coordinate assignment) rather than being tautological.

EEGLAB parity notes

None — parity-sensitive behavior (FIR design math, BIDS montage inference, 1-based latency handling, EEG-dict fields) is unchanged by the move.


Note: I could not execute the test suite in this environment (sandbox-blocked), so the verification above is static. Given the PR is a code-movement decomposition with no logic changes, static verification of move fidelity + import resolution covers the risk.

@suraj-ranganath
suraj-ranganath force-pushed the phase/212-bids-qt-fir-ownership branch from 97003fb to b97ad66 Compare June 12, 2026 07:40
@suraj-ranganath

Copy link
Copy Markdown
Member Author

🤖 Addressed the Claude review nit by restoring the fuller Parameters/Returns docstrings on the canonical firfilt design helpers in b97ad66.

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.

1 participant