Repository navigation
Closed
Labels
phaseEpic implementation phase
Description
π€ Part of #207. This phase establishes the shared behavior contracts that later phases should consume instead of reimplementing locally.
Summary
Replace divergent low-level contracts with one canonical implementation for user-facing booleans/numeric vectors, boundary-event detection, console history mutation, and small history/serialization helpers. These are behavior-sensitive because current copies disagree, so fix from first principles and use EEGLAB as the parity oracle where applicable.
Scope
Covers remaining findings from #197/#205 including:
is_on,is_empty_value, and numeric sequence parsing copies acrosspopfunc,sigprocfunc/headplot.py,timefreqfunc/newtimef.py,newcrossf.py,timefreq.py, andtf_cycle_calc.py.- Boundary-event detection forks; route through the canonical EEGLAB-compatible
eeg_findboundariesbehavior where correct. ConsoleEeghdestructive and append paths mutatingALLCOM/LASTCOMwithout session notification.- Small canonical helper cleanups such as
pop_topoplothistory literal reuse,pop_savesetchanloc struct serialization,pop_topochansellabel/index resolution, and dead duplicate CLI error helpers if still present.
Acceptance Criteria
- One shared lower-level value helper module is used by pop/timefreq/sigproc callers without introducing upward imports from lower layers into
popfunc. - Boundary checks match EEGLAB semantics: string boundary events and numeric boundary sentinels are handled consistently and tested across
pop_resample,eeg_eegrej,pop_rmdat,pop_selectevent, and any other current fork. eegh()append, clear, and removal paths updateEEGPrepSessionthrough session helpers and notify listeners without duplicating history entries.- History strings remain valid Python and GUI plus
eegprep-consolehistory stays synchronized. - Regression tests cover previous divergent cases, including MATLAB-style numeric strings, ndarray/list boolean values, numeric boundary events, and console workspace listeners.
- Run focused tests plus
ruff,ruff format --check,ty, and./pre-commit.py --changed-from origin/develop.
References
AGENTS.md.agents/skills/eegprep-feature-development/SKILL.md.agents/skills/github-pr-review/SKILL.md- EEGLAB boundary behavior via
eeg_findboundaries.mreference in the vendored EEGLAB tree.
/goal Prompt
/goal Complete Fable 5 architecture closeout Phase 1 from issue #<THIS_ISSUE>: consolidate shared boolean/numeric parsing, boundary-event detection, console history mutation, and small history/serialization helpers into canonical EEGPrep-owned code. Use #197/#205 as the audit source, inspect EEGLAB behavior before changing boundary/history semantics, preserve standalone runtime behavior, add regression tests for every changed contract, verify GUI plus eegprep-console synchronization where relevant, and run focused pytest plus ruff, format, ty, and pre-commit. Do not broaden into unrelated refactors; report any remaining incompatible finding explicitly.
Metadata
Metadata
Assignees
Labels
phaseEpic implementation phase
Activity
suraj-ranganath commentedon Jun 12, 2026
π€ # Research
Boolean/numeric parsing currently lives in
popfunc._pop_utils, while lower-levelsigprocfuncandtimefreqfuncimport upward or keep local vector parsers; this makes shared contracts depend on caller layer and leaves colon/string behavior inconsistent. Boundary detection has three active predicates with conflicting sentinel behavior: EEGLABeeg_findboundaries.muses stringstrmatch('boundary', ...)or numeric-99whenoption_boundary99is on, while_event_utilstreats-1as boundary andeeg_eegrej/pop_resamplekeep their own copies.ConsoleEeghmutatesALLCOMthrougheegh()and clearsLASTCOMdirectly, so append/clear/remove can skipEEGPrepSession.notify_changed()and leave console listeners stale.Relevant code
src/eegprep/functions/popfunc/_pop_utils.py#L57-L105- pop-owned value parsingsrc/eegprep/functions/popfunc/eeg_findboundaries.py#L48-L60- EEGLAB boundary shapesrc/eegprep/functions/popfunc/_event_utils.py#L93-L98- conflicting numeric sentinelsrc/eegprep/functions/popfunc/pop_resample.py#L214-L236- local boundary predicatesrc/eegprep/functions/adminfunc/console.py#L267-L280- direct history mutationProposed Fix
Move value parsing to a lower-level EEGPrep-owned helper used by
popfunc,sigprocfunc, andtimefreqfunc, with tests for MATLAB-style numeric strings and ndarray/list booleans. Makeeeg_findboundariesthe canonical boundary implementation, route pop/event/rejection helpers through it, and preserve EEGLAB string-prefix plusoption_boundary99 == -99behavior in numeric cases. Add a session-level history mutator for append/clear/remove, updateConsoleEeghto use it, and cover listener notification plus no duplicate history entries in console workspace tests.suraj-ranganath commentedon Jun 12, 2026
π€ Phase 1 implementation is up in PR #214: #214
Implemented shared value parsing, canonical boundary detection, session-level eegh history mutation, and the still-present pop_topoplot history-helper cleanup. Focused regression coverage is in place for numeric/string boundary paths, ndarray/list booleans, numeric vector parsing, and console listener notifications.
Local checks: focused pytest suites passed; ruff check passed; ruff format --check passed; pre-commit changed-from feature/fable5-architecture-closeout passed. ty check is blocked locally by missing optional torch imports in existing ICLabel/tooling files. PR review CI passed.
suraj-ranganath commentedon Jun 12, 2026
π€ Completed by merged phase PR #214 into feature/fable5-architecture-closeout.