Repository navigation
[pop_importepoch] Accept a one-row table on a single trial dataset - #852
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.
Cover a one-sweep 3-D dataset importing epoch info and 2-D continuous data still being rejected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
4feb33f to
17493aa
Compare
|
Review (Claude Fable): needs Arno
DetailsWhat I checked
EEGLAB on the case the test rejects EEG = pop_importdata('data', zeros(1,3), 'srate', 100, 'dataformat', 'array'); % trials=1, ndims=2, xmin=0
EEG2 = pop_importepoch(EEG, {'Correct'}, {'response'});
% MATLAB ACCEPTED: nevents=1 type=TLE latency=1 response=Correct, EEG.epoch emptyEEGPrep on the same input raises Why the guard is fragile In MATLAB a single sweep and a continuous recording are the same array, because the trailing dimension of size one is dropped. The Python guard
So the test locks a rule that depends on an internal array shape, not on anything the user sees, and that differs from EEGLAB. The two options
GUI rules Rule 21 is met (one file, 11 lines). Rule 27: the change is a test only, no window and no number changes, so no capture and no histogram are needed. Rule 33 is met: issue #843 names the earlier issue #738. Rules 23, 26 and 34 are not concerned, no dialog code is touched. — orchestrator review |
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Code reviewIndependent review by Codex (OpenAI GPT-6.1 Terra, high reasoning effort), asked by the orchestrator, which made the change with Claude Fable. Codex read commit 684dd07 in a read-only sandbox. It found nothing blocking. Its three important points are answered below, and its text follows unchanged. What was done with its findings
Codex's review, unchangedBlockingNone. ImportantSingle trial imports are unavailable through the menu. eeglab_menu.py:61 disables epoch import for continuous data, and session.py:748 classifies every dataset with one trial as continuous, including a single sweep. Decide whether to enable the menu for these datasets and test the GUI flow. Check EEGLAB’s menu behavior before claiming GUI parity. The help promises metadata that is discarded. pop_importepoch.md:26 and interactive_pop_workflows.rst:100 say the imported row remains in A long continuous recording can lose events. pop_importepoch.py:95 clears old events by default and also clears events without an NitsNone. The changelog accurately describes acceptance of a single row, although it does not describe the event replacement risk. Test gapstests/test_pop_importepoch_current.py:204 passes and checks the supplied MATLAB event values and empty epoch structure. The original guard would reject its first call. Add a long continuous recording with existing events and Removing the guard is consistent with the supplied MATLAB result. I found no further single trial division or indexing failure in the import path. The local MATLAB reference file is absent, so I could not independently inspect it or verify continuous event handling. GitHub access was unavailable, so the live PR head, description, and required premerge MATLAB reference evidence could not be checked. Merge recommendation: Request changes for the documentation and resolve the single trial GUI behavior before merging. — orchestrator |
# Conflicts: # docs/source/changelog.rst
|
@copilot resolve the merge conflicts in this pull request |
…-843 # Conflicts: # docs/source/changelog.rst Co-authored-by: copilot-swe-agent[bot] <[email protected]>
EEGPrep refused a one-row table on a dataset with a single trial ("pop_importepoch requires an epoched dataset"). EEGLAB accepts it:
pop_importepoch.mline 266 only compares the number of rows withEEG.trials. Arno approved following EEGLAB on November 28, 2026. This removes the guard (2 lines), replaces the test that required the error, and updates the help and the changelog.Comparison with EEGLAB (MATLAB R2025b, EEGLAB 4207693), same input on both sides
EEG = pop_importdata('data', zeros(1,3), 'srate', 100)thenpop_importepoch(EEG, {'Correct', 0.01}, {'response','rt'}, 'latencyfields', {'rt'}).epochfield in eventsEEG.epochTwo rows on the single trial are refused on both sides (the rows must match
EEG.trials).Verification
tests/test_pop_importepoch_current.pyand the importer workflow tests: 27 passed. The new test fails with the guard in place. Pre-commit and Ruff pass.tests/test_package_help.py::test_every_public_optional_path_carries_its_markerfails on develop as well and is not touched by this change. EEGLAB reference workflow on this branch: https://github.com/sccn/eegprep/actions/runs/46238670776 (started on the first commit; its result is not known yet). The menu entry stays greyed for continuous data, as in EEGLAB (onepoch).Fixes #843
🤖 Generated with Claude Code