Skip to content

Phase 6b: Public API, plugin management, package data, and examples #81

Closed

Description

@suraj-ranganath

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

Goal

Harden EEGPrep's public API, plugin-management UX, package data, and examples so completed workflows are discoverable and usable as a standalone Python package.

Target branch and PR flow

  • Create the phase branch from feature/study-standalone-completion.
  • Open the phase PR back into feature/study-standalone-completion.
  • The phase PR should close this issue.

Dependencies

In scope

  • Public exports for completed pop_*, eeg_*, STUDY, plugin, GUI, and console workflows.
  • Plugin-management UX for in-repo bundled plugins.
  • Package data, examples, and install/runtime smoke paths.
  • API documentation and example updates for mixed GUI/console workflows.
  • Tests that public imports remain lightweight and stable.

Out of scope

  • Help/admin menu resource ownership; see Phase 6a.
  • Final full-epic integration evidence; see Phase 6c.
  • External plugin repositories not vendored in this repo.

Acceptance criteria

  • Public API exports are intentional, documented, and tested.
  • Plugin-management UX accurately represents bundled/in-repo plugins and clear external-plugin exclusions.
  • Examples run or are testable as docs/examples smoke tests where practical.
  • Package data needed by help, GUI, plugins, examples, and console workflows is included.
  • Required lint/type/test commands pass.

/goal prompt

/goal Complete EEGPrep public API, plugin-management, package-data, and examples hardening for standalone use. Inspect existing API/docs conventions, expose completed workflows intentionally, package required resources, add tests for public imports/plugins/examples/package data, verify mixed GUI/console guidance, and run ruff/format/ty plus focused and non-slow pytest before opening the PR to the STUDY epic branch.

Activity

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

    @claude
    Contributor

    🤖 Plan / Analysis (Phase 6b is too large for a single agent PR — proposing decomposition for human review)

    Scope check

    This is a multi-module epic phase (public API, plugin-management UX, package data, examples, docs, tests). It cannot land as one <100-line agent PR. Phase branch `feature/study-standalone-completion` does not yet exist on origin (only `origin/feature/eeglab-completion` is present), so even the branching prerequisite is unmet. Recommending decomposition into 4 follow-up sub-issues; each becomes a small PR into the phase branch once a human creates it.

    Current state (relevant code)

    • `src/eegprep/init.py#L15-L120` — lazy `_LAZY_EXPORTS` dict drives the public surface; `STUDY` exports (`pop_loadstudy`, `pop_savestudy`, `pop_study`, `pop_studyerp`, `pop_studywizard`) are present but `eegprep-console`, `EEGPrepSession`, `inputgui`, and the firfilt/dipfit plugin entry points are not.
    • `docs/source/api/index.rst` — `autosummary` covers preproc/ICA/IO but omits STUDY, console, session, plugin menus, and BIDS pop wrappers (`pop_importbids`, `pop_exportbids`).
    • `src/eegprep/plugins/{dipfit,firfilt}/menu.py` — bundled plugin menus exist; no plugin-management dialog enumerates them or surfaces enable/disable state.
    • `pyproject.toml#L184-L201` — `package-data` includes help/montages/`netICL.mat` but not `plugins/dipfit/`, `plugins/EEG_BIDS/` resources, `plugins/firfilt/**`, or any STUDY sample data; `include-package-data=true` covers Python files but not non-Python plugin assets.
    • `tests/test_package_exports.py` — only 2 tests; no coverage for the full `_LAZY_EXPORTS` table or lazy-import side-effects (matters because regressions in lazy loading silently break public imports).
    • `docs/source/examples/` — 5 `plot_*.py` gallery scripts, all synthetic-data; no STUDY example, no console-workflow example, no plugin-management example.

    Proposed decomposition (each is a separate PR into `feature/study-standalone-completion` after the human creates that branch)

    6b-1: Public API surface and lazy-export tests (~150 LOC)

    • Add missing exports to `_LAZY_EXPORTS`: `EEGPrepSession`, `inputgui` (if user-facing), `pop_newset`, and any STUDY helpers used in the console.
    • Audit `_LAZY_EXPORTS` for stale entries (any pointing at modules that no longer exist).
    • Replace `tests/test_package_exports.py` content with a parametrized test that walks every `_LAZY_EXPORTS` key, imports it, and asserts `is` identity vs. the direct import — catches lazy-loading regressions cheaply.
    • Add a test that `import eegprep` does not import `PySide6`, `torch`, or `mne` (lightweight-import guarantee).

    6b-2: Plugin-management UX for bundled plugins (~250 LOC)

    • Add `pop_managePlugins` (EEGLAB parity name) dialog under `functions/adminfunc/` listing bundled plugins (`clean_rawdata`, `ICLabel`, `EEG_BIDS`, `dipfit`, `firfilt`) with version/description from each plugin's `init.py`.
    • Read plugin metadata from each plugin package; no enable/disable persistence in v1 (bundled = always available), but show an "external plugins not supported" note explicitly.
    • Wire into existing eeglab GUI menu; add help resource at `resources/help/pop_managePlugins.md`.
    • Visual parity capture against EEGLAB's "Manage extensions" dialog via the `eeglab-gui-visual-parity` skill.

    6b-3: Package data and standalone install smoke (~80 LOC)

    • Extend `[tool.setuptools.package-data]` to cover `plugins/dipfit//.mat` and `.locs`, `plugins/EEG_BIDS/` JSON templates, `plugins/firfilt/` if any data, and `functions/studyfunc/` resources used at runtime.
    • Add a CI smoke test that pip-installs from a built sdist/wheel into a clean venv and imports `eegprep`, opens the GUI in headless mode, and runs one `pop_loadset`/`pop_saveset` round-trip on bundled sample data. (Test marker: `slow`.)
    • Verify `exclude-package-data` correctly excludes the `eeglab/` vendor tree from wheels (check with `unzip -l dist/*.whl | grep eeglab`).

    6b-4: Examples and docs for STUDY/console (~150 LOC docs)

    • Add `docs/source/examples/plot_study_workflow.py` covering STUDY create/save/load with bundled sample data.
    • Add `docs/source/examples/plot_console_workflow.py` showing the mixed GUI/console pattern (Session, `pop_*` history capture, `ALLEEG` sync).
    • Update `docs/source/api/index.rst` autosummary to include STUDY exports, `EEGPrepSession`, `pop_importbids`/`pop_exportbids`, and the new plugin-management entry point.

    Open questions for human reviewer

    1. Should `EEGPrepSession` and `inputgui` be public `eegprep.*` exports, or remain internal (`eegprep.functions.guifunc.session`)? Console/notebook users likely want `EEGPrepSession` public.
    2. Should plugin-management UX support discovery of installed third-party plugins via entry points (closer to EEGLAB extension manager) or strictly enumerate the bundled set (faster, simpler, matches "no external plugins" scope statement)? Scope says external is out-of-scope, so I lean strictly bundled.
    3. Is `pop_managePlugins` the right name for EEGLAB parity, or should it be `pop_pluginManager` / `eeg_plugins`? EEGLAB itself uses `eeg_manage_extensions` / `pop_pluginmanager` depending on version — needs confirmation against the vendored reference at `src/eegprep/eeglab/`.
    4. Should the standalone install smoke test run on all CI platforms or Linux-only? `required-environments` in pyproject already constrains uv to linux/x86_64.

    Status

    • Read AGENTS.md, fix-issue, pull-request skills
    • Fetch issue and parent epic Epic: STUDY and standalone EEGPrep integration parity #78
    • Duplicate-work preflight (no overlapping open PRs/issues for Phase 6b)
    • Inventory current public API, plugin code, package data, examples, docs
    • Post analysis + proposed decomposition (this comment)
    • Awaiting human reviewer to (a) create `feature/study-standalone-completion` branch and (b) approve decomposition / answer open questions before any sub-PRs are opened
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