Repository navigation
[GUI] Load the continuous or epoched sample at console startup - #837
Conversation
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Claude finished @arnodelorme's task in 56s —— View job Code review
BlockingNone. Important
Nits
Test gaps
EEGLAB parity notes
|
| if args.dataset: | ||
| filename = "eeglab_data.set" if args.dataset == "cont" else "eeglab_data_epochs_ica.set" | ||
| sample = Path(__file__).resolve().parents[4] / "sample_data" / filename | ||
| if not sample.is_file(): | ||
| sample = Path(sysconfig.get_path("data")) / "share" / "eegprep" / "sample_data" / filename | ||
| session.store_current( | ||
| pop_loadset(sample), new=True, command=f"EEG = pop_loadset({str(sample)!r});", mark_saved=True | ||
| ) |
There was a problem hiding this comment.
Important: the installed-wheel lookup is fragile and doesn't follow repo convention.
The installed path depends on [tool.setuptools.data-files] (
Lines 298 to 306 in 8bb71ed
sysconfig.get_path("data"). Two problems:
- Paths can disagree. pip writes
data-filesinto the active install scheme's data directory.sysconfig.get_path("data")returns the interpreter's default scheme. Withpip install --user eegprepthe files go undersite.USER_BASE/share/..., but the lookup checkssys.prefix/share/..., soeegprep-console contraises a rawFileNotFoundErrorfrompop_loadset. Setuptools also marksdata-filesin pyproject as deprecated. parents[4]is a layout guess. In a source checkout it resolves to the repo root. In site-packages it resolves tolib/pythonX.Y. That only works because the fallback happens to catch it.
The rest of the package ships runtime data as package data and reads it with importlib.resources, e.g. extension_catalog.py, EEG_BIDS/montage.py, and the ICLabel ONNX model. AGENTS.md says the same: "make them EEGPrep-owned packaged resources."
Suggested fix: Put the four files under src/eegprep/resources/sample_data/, or symlink or copy them at build time if sample_data/ has to stay at the root for EEGLAB naming. Add "resources/**/*.set" and "resources/**/*.fdt" to [tool.setuptools.package-data], drop data-files, sysconfig, and the parents[4] probe, and resolve with:
sample = files("eegprep.resources").joinpath("sample_data", filename)That gives one lookup that works in editable, venv, --user, pipx, and conda installs. A test that loads through files(...) would then cover the installed layout as well, not only the checkout path.
|
Review (Claude Fable): needs Arno
DetailsWhat I ran
The lookup that misses
Smallest fix: after the two candidates, test I do not recommend the package data move proposed in the automatic review (copy the files under Parity with EEGLAB
Minimal 52 lines in 4 files, no refactoring. The checkout only variant would drop the 8 lines of Tests and docs
What the pull request shows (rules 27 and 29) Summary on top, two side by side captures (EEGLAB and EEGPrep, continuous and epoched), the difference figure, and the Word and PDF reports, which both exist at the linked paths. There is no "before" capture, which is normal since the command did not exist. Rules 23, 26 and 34 do not apply: no dialog layout code is touched. — orchestrator review |
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Code reviewThis is an independent review by Codex (OpenAI, model gpt-6.1-terra, high reasoning effort), run read only on commit What was fixed after the review
What was left, and why
This change is packaging and one message. It moves no number, so no EEGLAB parity run is needed. The review of Codex, as writtenOverall assessmentNeeds changes: the lookup can load an unrelated recording, and a missing BlockingNone. Important
NitsNone. Test gaps
— orchestrator |
|
🤖 I merged this pull request into develop, at Arno's request. Why. Arno wrote on November 28 "Yes, it only installs with a Why it was good to merge. The two sample recordings are out of the wheel and load from a source checkout only, which is the first half of his sentence. The review by Codex found nothing blocking. I merged develop into the branch this morning (head 2a0d699), and every check of that head passed, the one-hour Pyodide check included. What is not done here. With — orchestrator |
From a source checkout, run
uv run eegprep-console contoruv run eegprep-console epochto open the matching sample with dataset 1 selected in the GUI and console (--fullis optional). The two sample recordings stay in the repository and are not in the wheel, which is back to 26.7 MB (it was 34.0 MB with them). When they are missing, the console prints how to get them and starts without a dataset.Both recordings matched EEGLAB sample for sample, including 32 channels at 128 Hz. The continuous recording had 154 events, and the epoched recording had 157.
Editable Word report · PDF report
Cause and change
The launcher accepted only flags. It now loads the requested sample through
pop_loadsetand stores it in the shared session before opening the window.Verification
249 local GUI and console tests passed. Four reference cases were deselected. Pre-commit, Ruff and ty passed. Both actual launch commands and both corresponding EEGLAB commands ran on jamming. After the recordings were taken out of the wheel (commits 39d95b4 and 7c4f6f6), the built wheel is 26,716,445 bytes and holds no
.setand no.fdtfile. A clean Python 3.12 environment installed that wheel and ran both real console commands outside the checkout: each printed the message that namesgit clone https://github.com/sccn/eegprepanduv run eegprep-console cont, opened the console without a dataset and ended with status 0.tests/test_console_workspace.pygives 115 passed. No number changes, so no EEGLAB parity run is needed for this packaging change. Windows CI reports the pre-existing one-pixel Qt row check #834, addressed by #835. Windows job.Decision taken by Arno
The two recordings are kept out of the default wheel. They are loaded only from a source checkout (or an editable install), where
sample_datasits besidesrc/eegprep. The new arguments apply to eegprep-console.Fixes #824