Skip to content

Phase 5a: STUDY metadata, design, file I/O, and session synchronization #65

Closed

Description

@suraj-ranganath

🤖 Phase issue for the STUDY and standalone integration epic #78.

Goal

Implement STUDY metadata, design, file I/O, and session synchronization foundations so later STUDY measure/clustering work has stable contracts.

Target branch and PR flow

Dependencies

In scope

  • STUDY creation from loaded datasets and browse/select workflows.
  • STUDY load/save/resave and clear-study behavior.
  • STUDY metadata editing.
  • STUDY design editing, variables, factors, and dataset consistency checks.
  • STUDY, CURRENTSTUDY, ALLEEG, and CURRENTSET synchronization through EEGPrepSession and eegprep-console.
  • Relevant menu actions, GUI dialogs, help Markdown, history strings, and valid Python console echoes.

Out of scope

  • Measure precompute, measure plotting, and clustering; see Phase 5b.
  • Final end-to-end STUDY hardening and broad parity fixtures; see Phase 5c.
  • External-only LIMO behavior unless explicitly represented by a clear user-facing message.

Acceptance criteria

  • STUDY create/load/save/edit/design workflows are usable from GUI, Python API, and eegprep-console.
  • Multi-dataset selection and STUDY dataset membership follow the contracts established in Epic: Complete EEGPrep core EEGLAB parity except browser and external plugins #60.
  • Commands emitted by GUI are valid Python and replayable.
  • Tests cover sample/multi-dataset fixtures, cancel/error paths, 1-based UI indices versus Python internals, session synchronization, and deterministic MATLAB parity where feasible.
  • GUI dialogs have visual parity captures and PR user-attachment side-by-side images.
  • Required lint/type/test commands pass.

/goal prompt

/goal Complete EEGPrep parity for STUDY metadata, design, file I/O, and session synchronization workflows against EEGLAB. Use the #60 session/history/menu contracts, inspect EEGLAB source first, implement GUI/API/eegprep-console paths, add sample and multi-dataset tests plus MATLAB parity where deterministic, add visual parity screenshots for GUI dialogs, run ruff/format/ty and focused plus non-slow pytest, and iterate 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:

    • Confirm issue scope (phase epic, not a single bug)
    • Inventory current STUDY surface vs Phase 5 acceptance criteria
    • Duplicate-work preflight (no open PRs or sibling issues overlap)
    • Post research + proposed decomposition (no PR — exceeds 100-line/multi-module threshold)

    Research

    Phase tracking issue for the full STUDY/group-level workflow port. Current STUDY surface in EEGPrep is a thin stub: only minimal create/load/save plus an ERP wrapper exist, no designs, no precompute, no clustering, no std_* helpers, and no multi-dataset parity fixtures. All advanced STUDY menu items are wired to the not-implemented placeholder dispatcher.

    Current state

    Proposed Approach

    This is a multi-week, multi-module port. Open Phase 5 as a long-lived branch (feature/phase-5-study cut from feature/eeglab-completion) and decompose into focused sub-PRs that each merge into the phase branch. Suggested sequence:

    1. STUDY data contract + eeg_checkset-style validator. Land the full STUDY dict shape (name, task, notes, filename, filepath, datasetinfo, subject, condition, group, session, run, changrp, cluster, design, etc, history) and std_checkset. Includes a multi-dataset fixture under sample_data/study_demo/ and pytest covering create/save/load round-trip with non-trivial fields.
    2. Design/variables/factors. Port std_makedesign, std_selectdesign, pop_studydesign, std_combtrial, plus dataset consistency check (std_checkdatasetinfo). Wire pop_studydesign into menu_actions, replacing the placeholder.
    3. Channel/component precompute. Port std_precomp, std_readdata/std_readfile, measure file I/O (.dat*, .ica*), pop_precomp for both channels and components variants. Reuse existing ERP/spectral routines where present; add MATLAB parity tests for a deterministic measure (e.g. ERP mean) on the two-dataset fixture.
    4. Plotting. std_erpplot, std_specplot, std_erspplot, std_itcplot, std_topoplot, plus pop_chanplot. Gate behind Phase 4 plotting primitives — explicitly note dependency in the phase PR.
    5. Clustering. std_preclust, std_pca, std_kmeans/std_dipoleclust, pop_preclust, pop_clust, std_editset, pop_clustedit. Cluster data structures must match EEGLAB so .study files round-trip.
    6. STUDY file I/O hardening. JSON schema validation, relative-path resolution for dataset files (mirror EEGLAB behavior when STUDY is moved), version field, migration of the current bare-bones format.
    7. GUI + console sync. For each new pop_*, add return_com=True, update menu_actions._study_action, and extend tests/test_console_workspace.py for namespace/history sync. GUI visual parity captures via the eeglab-gui-visual-parity skill.
    8. Explicit LIMO exclusion. Add user-facing not-implemented messages (consistent with existing placeholder pattern) and a single doc page.

    Out of scope reminders (from issue body): LIMO and runtime dependence on vendored EEGLAB.

    Open questions for the human owner before implementation starts

    • Persist STUDY as JSON (current pop_savestudy) or add a .set-style MAT-v7 path for true EEGLAB binary parity? JSON is simpler; MAT enables MATLAB to open EEGPrep-written .study files directly.
    • Should std_precomp write EEGLAB-compatible .dat*/.ica* files, or EEGPrep-native sidecars with a converter? The former preserves cross-tool workflows; the latter is cleaner.
    • Cluster algorithm parity target: bit-exact with EEGLAB kmeans/pca paths (requires seeded RNG matching) or behavioral parity only?
    • Multi-dataset sample fixture: synthesize 3-4 small subjects from existing eeglab_data.set, or check in a trimmed real study?
    • Dependency ordering vs Phase 4: should the phase branch block on Phase 4 plotting primitives, or stub plotting and unblock later?

    Will not open a PR. Awaiting decisions on the open questions before starting sub-PR 1.

  3. changed the title [-]Phase 5: STUDY and group-level workflows[/-] [+]Phase 5a: STUDY metadata, design, file I/O, and session synchronization[/+] on May 28, 2026
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