Skip to content

Phase 2: File format and channel-location long tail #133

Closed

Description

@suraj-ranganath

🤖

Phase 2: File Format And Channel-Location Long Tail

Summary

Port useful EEGLAB import/export/channel-location workflows from the parity matrix. This phase should make EEGPrep stronger as a standalone tool for researchers loading, saving, and repairing real EEG datasets, without blindly porting obsolete format helpers.

Can start after Phase 1 merges. Can run in parallel with Phases 3 and 4.

Scope

Prioritize:

  • pop_readlocs, pop_writelocs, readlocs, writelocs
  • location helpers such as convertlocs, chancenter, pop_chancenter, pop_chancoresp when user-facing or workflow-required
  • EGI/BCI/snapread import paths only if documented, fixture-testable, or used by menu/API paths
  • BIOSIG legacy wrappers only when they map cleanly to existing modern import behavior

Do not port stale import helpers just because same-name MATLAB files exist. Update the parity matrix with explicit skip rationale instead.

Acceptance Criteria

  • File/channel-location APIs work standalone with packaged resources or explicit user files.
  • GUI dialogs, if added or changed, visually match EEGLAB and include side-by-side PR attachments.
  • User-facing commands support return_com=True and produce valid Python console history.
  • GUI paths update EEGPrepSession, LASTCOM, ALLCOM, EEG, ALLEEG, and CURRENTSET correctly.
  • Tests cover sample data, synthetic location files, malformed files, 1-based UI index handling, cancel/error paths, and MATLAB parity where deterministic.
  • Parity matrix rows touched by this phase are updated to implemented, partial, consolidated, or explicit skip.

Verification

Run focused tests for touched loaders/writers/dialogs, then:

  • uv run --no-sync ruff check .
  • uv run --no-sync ruff format --check .
  • uv run --no-sync ty check
  • EEGPREP_SKIP_MATLAB=1 uv run --no-sync pytest -m "not slow" as risk requires
  • MATLAB parity tests where available and deterministic
  • GUI visual parity workflow for any dialog changes

/goal Prompt

/goal Complete EEGPrep parity for file-format and channel-location long-tail workflows from the parity matrix. Port only user-facing or workflow-required EEGLAB behavior, keep runtime standalone, add GUI/console/API paths where relevant, update the parity matrix, and verify with fixtures, MATLAB parity where deterministic, visual parity for dialogs, ruff/format/ty, and focused pytest.

Activity

  1. added
    phase
    on Jun 5, 2026
  2. claude commented on Jun 5, 2026

    @claude
    Contributor

    🤖 Plan:

    Research

    Phase 2 is an epic-sized port of EEGLAB's file-format and channel-location long tail. None of the named functions exist in src/eegprep today — grep -RniE "readlocs|writelocs|convertlocs|chancenter|chancoresp" src/eegprep returns zero hits. Per epic #131 the recommended merge order is `1 -> 2 + 3 + 4 -> ...` and Phase 1 (#132) is still OPEN, so Phase 2 has an unmet upstream dependency on the parity matrix and porting contracts.

    Relevant code / refs

    Scope (why no PR)

    The acceptance criteria require, per ported user-facing function: Python API, GUI dialog with EEGLAB visual parity (side-by-side attachments), `return_com=True` history, `EEGPrepSession`/`LASTCOM`/`ALLCOM`/`ALLEEG`/`CURRENTSET` sync, packaged help Markdown, and tests (synthetic + malformed + 1-based UI indexing + cancel/error + MATLAB parity where deterministic). Realistic LOC for the minimal must-port set (`pop_readlocs`, `pop_writelocs`, `readlocs`, `writelocs`, `convertlocs`, `chancenter`, `pop_chancenter`, `pop_chancoresp`) is several thousand lines across `functions/popfunc/`, `functions/sigprocfunc/`, `functions/guifunc/`, `resources/help/`, `tests/`, plus parity-matrix entries. That exceeds the small-bug-fix threshold for a single agent PR.

    Additionally, the vendored EEGLAB reference at `src/eegprep/eeglab/` is empty in this environment, so MATLAB-side parity capture cannot be done here without first vendoring the reference sources for these specific files.

    Proposed Approach (for human review)

    Split this phase into independently mergeable sub-PRs, gated on #132 merging first so the parity matrix exists to record per-row status:

    1. `readlocs`/`writelocs` core (sigprocfunc) — pure format I/O for .loc/.locs/.ced/.elc/.elp/.xyz/.sfp without GUI. Tests: round-trip each supported extension against synthetic fixtures and EEGLAB-produced reference files; malformed-file handling; MATLAB parity for one canonical .ced and one .elp.
    2. `convertlocs` + `chancenter` — coordinate-system conversions (cart↔sph↔topo) and re-centering. Pure-math ports; deterministic MATLAB parity tests against `chanlocs` fixtures.
    3. `pop_readlocs` + `pop_writelocs` — GUI dialogs (EEGLAB visual parity), file-type detection, console `return_com=True` history, session sync. Side-by-side screenshots attached to PR.
    4. `pop_chancenter` + `pop_chancoresp` — geometry workflow dialogs reusing items 1-2.
    5. Conditional skips — `pop_readegi`/`pop_readsegegi`/`pop_loadbci`/`pop_snapread`/`pop_biosig16` and friends: explicit skip rationale in the parity matrix unless a fixture and live user path are documented. Do not port stale helpers just because a same-name MATLAB file exists (per epic global rules).

    Each sub-PR targets `feature/eeglab-core-parity-completion` (the epic branch), not `develop`, per #131. Recommend a human assigns these as individual issues or as `/goal` invocations so each one runs through the `eegprep-feature-development` skill end-to-end.

    Blockers before any sub-PR can start:

    • Phase 1 (Phase 1: Parity matrix, staleness triage, and porting contracts #132) must merge so the parity matrix file exists and the rows for section 7 can be updated authoritatively.
    • The vendored EEGLAB reference for these specific files needs to be present locally (or each agent run must clone/vendor them on the fly) so MATLAB-side parity capture works.
  3. suraj-ranganath commented on Jun 7, 2026

    @suraj-ranganath
    MemberAuthor

    🤖 Resolved by the work now included in PR #152. Closing this constituent phase/follow-up issue now; parent epic #131 remains open until the epic PR merges.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions