Skip to content

Phase 1b: File, dataset, event, and channel metadata parity #67

Closed

Description

@suraj-ranganath

🤖 Phase issue for the EEGLAB completion epic.

Goal

Complete File/Edit feature parity for dataset metadata, event metadata, channel metadata, and multi-dataset state using the shared contracts established in Phase 1a.

Target branch and PR flow

  • Create the phase branch from feature/eeglab-completion after Phase 1a merges.
  • Open the phase PR back into feature/eeglab-completion.
  • The phase PR should close this issue.

Parallelization

Can run in parallel with Phases 2, 3, and 4 after Phase 1a merges. Coordinate with Phase 5 for STUDY metadata assumptions.

In scope

  • Dataset metadata editing and comments.
  • Event field/value editing and event-based selection.
  • Dataset copy, merge, delete, and the user-facing multi-dataset selection mutator based on the Phase 1a selection-state contract.
  • Channel location editing/import/export, channel centering, and channel correspondence helpers.
  • File/Edit menu placeholders in this category.
  • GUI dialogs, help Markdown, console commands, history strings, and menu dispatch for the implemented workflows.

Out of scope

  • Shared contract design already handled by Phase 1a except for small local refinements discovered during implementation.
  • EEGBrowser/eegplot scrolling-browser workflows.
  • Runtime dependence on src/eegprep/eeglab.

Acceptance criteria

  • File/Edit menu actions in this category are implemented or explicitly excluded with browser/external rationale.
  • EEGPrepSession, GUI, and eegprep-console stay synchronized for all dataset/event/channel metadata mutations.
  • The multi-dataset selection mutator conforms to the Phase 1a selection-state contract and remains readable by STUDY workflows.
  • User-facing pop_* functions support return_com=True, valid Python console echoes, help Markdown, and GUI dispatch.
  • Tests cover sample_data, synthetic edge cases, 1-based UI indices versus Python internals, cancel/error paths, and MATLAB parity where EEGLAB behavior is deterministic.
  • GUI dialogs have visual parity captures and side-by-side PR attachments.
  • Required checks pass: focused tests, relevant MATLAB parity tests, uv run --no-sync ruff check ., uv run --no-sync ruff format --check ., uv run --no-sync ty check, and the non-slow pytest suite unless a documented external blocker exists.

/goal prompt

/goal Complete EEGPrep parity for File/Edit dataset, event, and channel metadata workflows against EEGLAB using the shared contracts from Phase 1a, including the Phase 1a multi-dataset selection-state contract but excluding EEGBrowser-dependent paths. Verify by comparing EEGLAB source behavior, implementing GUI/API/console paths, adding sample_data and MATLAB parity tests, adding visual parity screenshots for GUI dialogs, running focused tests plus ruff/format/ty and the non-slow suite, and iterating until review finds no actionable parity or correctness issues.

Activity

  1. added
    phase
    on May 27, 2026
  2. claude commented on May 27, 2026

    @claude
    Contributor

    🤖 Plan:

    Not opening a PR. Phase 1b is an epic-level phase covering ~10 user-facing workflows across popfunc/, guifunc/, resources/help/, adminfunc/console.py, and tests, plus per-dialog visual parity captures. Far above the 100-line single-PR threshold, and the issue itself says to split into sub-PRs against feature/eeglab-completion after Phase 1a (#61) merges. Phase 1a is still OPEN, so broad implementation here is blocked pending its merge.

    Research

    Phase 1b targets every Edit-menu (and one Datasets-menu) action currently routed to show_coming_soon for dataset/event/channel metadata and multi-dataset state. EEGLAB sources are not vendored under src/eegprep/eeglab/ in this checkout — implementers must read from https://github.com/sccn/eeglab during the port. feature/eeglab-completion exists but is identical to develop (no Phase 1a content yet).

    Scope inventory — placeholders to remove

    Menu label Action id EEGLAB ref to mirror Category
    Dataset info pop_editset pop_editset.m dataset metadata
    About this dataset pop_comments pop_comments.m dataset metadata
    Event fields pop_editeventfield pop_editeventfield.m event metadata
    Event values pop_editeventvals pop_editeventvals.m event metadata
    Select epochs or events pop_selectevent pop_selectevent.m event-based selection
    Select data using events pop_rmdat pop_rmdat.m event-based selection
    Channel locations pop_chanedit pop_chanedit.m channel metadata
    Copy current dataset pop_copyset pop_copyset.m multi-dataset state
    Append datasets pop_mergeset pop_mergeset.m multi-dataset state
    Select multiple datasets select_multiple_datasets eeglab.m cb_selectstudy region multi-dataset state

    All ten are registered in menu_placeholders.py#L11-L76; menu items already wired in eeglab_menu.py#L129-L139 and #L336; fall through to show_coming_soon at menu_actions.py#L252. Note pop_rmdat is not yet a module under functions/popfunc/; only pop_select, pop_delset, pop_adjustevents are implemented from the Edit submenu.

    Already in place

    • Session sync API: EEGPrepSession.store_current, add_history, notify_changed, retrieve, delete_current, clear_all in guifunc/session.py#L105-L185.
    • Pop-function GUI dispatch pattern: menu_actions.py#L643-L697 (_run_pop_function + _store_current_from_gui) — new pop functions plug in by adding a branch in dispatch() and an elif arm in _run_pop_function, and removing the id from PLACEHOLDER_ACTIONS.
    • Help resources: drop <function_name>.md under src/eegprep/resources/help/ (current set: pop_reref, pop_select, pop_runica, etc.).
    • Console workspace coverage: tests/test_console_workspace.py — extend per new pop function for bare-call auto-store and namespace sync.

    Relevant code

    Proposed Approach

    Block on Phase 1a (#61) merging into feature/eeglab-completion, then land the following sub-PRs against feature/eeglab-completion. Sequencing places lightweight metadata first (template for later PRs), stabilizes event-field shape before event-based selection consumes it, lands channel metadata before plotting phases need it, and lands select_multiple_datasets selection state before pop_mergeset consumes it.

    1. pop_comments — string-only dataset metadata; smallest PR, becomes the template (pop module + GUI dialog + Help md + dispatch + 2 tests).
    2. pop_editset — setname, subject, condition, group, session, chanlocs reference, sampling-rate display; uses eeg_checkset.
    3. pop_editeventfield — add/rename/delete event-struct fields; keep urevent field correspondence intact.
    4. pop_editeventvals — per-row event editor; relies on eeg_checkset('eventconsistency') already in eeg_checkset.py (covered by tests/test_eeg_checkset_eventconsistency.py).
    5. pop_selectevent + pop_rmdat — event-based epoch/continuous selection; share a helper that resolves event queries to sample ranges, then delegate to pop_select / pop_epoch.
    6. pop_chanedit — largest single dialog; channel struct editor with import/export, centering, cart/sph/topo round-trips. Coordinate parity is sensitive; recommend numerical tolerance budget pre-agreed in the PR.
    7. select_multiple_datasets + Datasets-menu multi-select state — surfaces selection vector on EEGPrepSession so Matlab conversion fixes and new eegrej function #8 and Pop epoch #9 can consume it.
    8. pop_copyset — EEGPrepSession.store_current(copy=True, ...) path; mostly session-layer.
    9. pop_mergeset — multi-dataset concatenation; needs boundary-event insertion and urevent recompute (reuse eeg_findboundaries.py).

    Each sub-PR must include, per AGENTS.md and the issue's acceptance criteria: pop module in functions/popfunc/pop_<name>.py, inputgui dialog spec, return_com=True + EEGLAB-style history string, Help Markdown in resources/help/, dispatch wiring + PLACEHOLDER_ACTIONS removal, test_console_workspace.py extension for bare-call auto-store, a sample_data-based unit test, a MATLAB parity test where EEGLAB behavior is deterministic, and a visual parity capture under tools/visual_parity/ attached side-by-side in the PR (not committed).

    Open questions for a human before implementation begins

    1. Is the 9-PR split acceptable, or should related actions group further (e.g., pop_editeventfield + pop_editeventvals in one PR)?
    2. Should pop_mergeset consume the multi-dataset selection state from PR EDF testing and MATLAB modification #7 (forcing the listed order), or accept explicit indices and treat selection state as a separate UI concern?
    3. Pre-agreed numerical tolerances for pop_chanedit coordinate transforms (cart ⇄ sph ⇄ topo round-trip) and pop_mergeset boundary-event semantics?
    4. CI gating: do all 9 sub-PRs need to land into feature/eeglab-completion before any non-slow / parity gate flips, or per-sub-PR gating with the epic PR re-running the full gate at integration?
    5. Confirm pop_rmdat belongs in this phase — the issue text says "event-based selection" but does not name pop_rmdat explicitly. Phase 2 ("Signal conditioning, filtering, baseline, and cleaning") could also claim it.

    No duplicate work detected: gh pr list --state open returns no PRs, and no closed PRs touch any of these pop_* ids.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

phase

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions