Repository navigation
Description
Summary
Hands-on GUI audit of the File menu (and the data import/export code behind it) on Nov 23, 2026, done as a researcher would: real menu clicks in the eegprep Qt GUI next to the EEGLAB GUI on the same screen, the same real datasets in both, outputs saved and compared file by file. This issue collects every File-menu finding (FAIL, MINOR, MISSING and NOT TESTED) into one stream so one PR can fix them together. Edit and Tools findings are in the companion issue #675 (Edit/Tools stream).
- eegprep:
developat6b8012cf2e1f7f1e336e963b77b464754393cbf3(re-checked withgit fetch origin developon Nov 23 11:05 PST: develop has not moved, so every file:line below is current and nothing here is fixed yet) - EEGLAB: pinned tree
8ac485f6(PINNED_COMMIT.txt= 8ac485f65). Neuroscan readers fromsccn/neuroscanio5915f10 and MFF frommffmatlabio(the pin only offers to download them) - Each finding was re-read from first principles against the EEGLAB source for the affected function; where that changed the audit's original root cause, the corrected cause is given below.
Datasets used (all public)
| Name in this issue | Source |
|---|---|
eeglab_data.set, eeglab_data_epochs_ica.set |
sample_data/ in this repo (and EEGLAB sample_data/) |
eeglab_data_numerical_events.set, test.bdf, test.cnt, testmff.mff, testbva.vhdr |
EEGLAB sample_data/test_data/ |
TESTEEG.EEG |
Neuroscan epoched .EEG test file (32 ch, 700 pnts, 1200 sweeps) used by the neuroscanio tests |
| P300 BIDS | OpenNeuro ds003061, sub-001 only (79 ch, 194048 pnts, 863 events) |
nepo01.edf |
20 ch, 200 Hz, 812 s EDF |
epochinfo.txt |
81 lines, tab separated, header Epoch RT Cond, row k = k 297+3k (1 if k odd else 2) for k = 1..80 |
ascii_4x512.txt |
4 x 512 random ASCII matrix |
STUDY auditstudy |
eeglab_data.set (S1) + eeglab_data_numerical_events.set (S2), task task1 |
Evidence (screenshots, saved outputs, clobbered files) is on the bot box under /workspace/gui-parity/audit-20261123/ (screenshots/, epout/, mlout/, findings.md, items_final.json). File names are quoted per finding.
Separability with #675 (Edit/Tools)
This stream owns: functions/guifunc/menu_actions.py (File-menu handlers only), functions/popfunc/ importers/exporters (pop_importdata, pop_biosig, pop_loadcnt, pop_fileio, pop_chanevent, pop_importepoch, pop_export, pop_expevents, pop_saveset, pop_loadset, pop_runscript, pop_saveh), functions/adminfunc/eeg_checkset.py (epoch event fields only), functions/studyfunc/, plugins/EEG_BIDS/, resources/extension_catalog.json. The Edit/Tools stream owns functions/guifunc/qt.py and the shared inputgui error handling; if this PR needs a change there, coordinate in the other PR.
A. Critical and high
1. BIDS import never writes derivatives; Resave then overwrites the raw BIDS file (FAIL, critical)
Menus: File > Import data > Using EEGPrep functions and plugins > From BIDS folder structure and File > BIDS tools > Import BIDS folder to STUDY (same callback).
- Repro: File > Import data > ... > From BIDS folder structure, pick the ds003061 folder, accept the pop_importbids defaults (event type
value, outputderivatives/eeglab), Ok. Then File > Resave current dataset(s). Comparemd5sum sub-001/eeg/sub-001_task-P300_run-1_eeg.setbefore and after. - eegprep now: dataset loads correctly (79 ch, 863 events, F16/F123 fixed) but nothing is written to
derivatives/eeglab,EEG.filename/filepathstill point at the raw BIDS.set, and Resave overwrites the source: md52975e3a5 -> bd90fed4, size 63516912 -> 63607968 (epout/clobbered_bids_source.set,screenshots/ep_bids_resave_20261123_022928.png). History also records'return_study', 'on', an option EEGLAB does not have. No Help button; event-type popup lists every events.tsv column. Import-to-STUDY picker opens in the repo folder. - EEGLAB:
plugins/EEG-BIDS/pop_importbids.m:287-296builds the output subject folder underopt.outputdir(defaultbidsFolder/derivatives/eeglab, line 182),:769pop_saveset(EEG, eegFileNameOut)writes each dataset there,:863-867writes<studyName>.studywithstd_editset,:892resaves. The source tree is never a save target (md5 unchanged in EEGLAB). - Root cause:
src/eegprep/plugins/EEG_BIDS/pop_importbids.py:84-95loads withpop_load_frombidsand returns without saving;functions/guifunc/menu_actions.py:1997-2001_resave_set_pathaccepts any existing.set;pop_importbids.py:462-477_history_commandappendsreturn_study. - Fix: (a) save each imported dataset into
outputdir/sub-XX[/ses-YY]/eeg/and write the.studythere, setfilename/filepathto the saved copy, exactly aspop_importbids.m:625,769,863; (b) defence in depth:_saveset(resave=True)(menu_actions.py:608) andpop_saveset(savemode='resave')refuse a target that sits inside a BIDS root (a parent folder holdsdataset_description.jsonand the path is outsidederivatives/), with a message namingpop_savesetand telling the user to use Save as; (c) dropreturn_studyfrom history; (d) add the Help button and restrict the event-type popup to the columns EEGLAB offers; (e) start the folder picker in the last data folder. - Test: GUI test that imports a tiny BIDS fixture into a tmp dir, asserts derivatives
.set+.studyexist,EEG.filepathis underderivatives/eeglab, and Resave leaves the source md5 unchanged; unit test for the BIDS-root guard; history string test. - Derivatives written, source untouched after Resave (both menu entries)
- Resave guard with an actionable message
- History matches
pop_importbids(folder, 'eventtype', 'value', ...)with noreturn_study
2. Import event info > From data channel: wrong edges, bool types, transform parser too strict (FAIL, high)
- Repro: load
eeglab_data.set, File > Import event info > From data channel, channel2(EOG1), transformX > 50(with spaces, as the label suggests), transitions Up, keep channel, Ok. Retry withX>50. - eegprep now:
X > 50fails with "Only simple X>threshold or X<threshold expressions are supported".X>50: 286 events typedTrue/False(rising and falling edges) while history says'edge','leading'. Dialog defaults differ: channel 1, Both, length 1, exampleX > 0(screenshots/ep_chanev_dlg_20261123_024736.pngvsml_chanev_dlg_20261123_024836.png). - EEGLAB:
functions/popfunc/pop_chanevent.m:224-231evaluates the transform as MATLAB code on the double channel (X = X>50;gives 0/1 doubles);:236-240diff(abs([X X(end)]))thenfind(tmpdiff > 0)for leading edges; dialog defaults at:126-147: channel blank,up (leading), length0, exampleX>3. Result: 143 events, all type 1, at rising edges (474, 536, 620, ...). - Root cause:
src/eegprep/functions/popfunc/pop_chanevent.py:216-223_apply_operreturns a bool array and only acceptsX>n/X<nwithout spaces;pop_chanevent.py:127np.diff(np.abs(...))on bool is XOR, so every change is "> 0" and the values become the event types. - Fix: cast the transformed channel to float64 before the diff; replace
_apply_operwith a small safe evaluator overX(comparison, arithmetic,abs,round,bitand,&,|, parentheses; no names other thanXand whitelisted numpy functions; never Pythonevalon raw text), accepting spaces and anX = ...form as EEGLAB does; set dialog defaults to EEGLAB's. - Test: regression test on
eeglab_data.setchannel 2 withX>50, leading: 143 events, all type 1, latencies equal to EEGLAB's (MATLAB parity script on jamming); parser tests for spaced and compound expressions and for rejection of unsafe input with a message namingpop_chanevent. - 143 events match EEGLAB exactly
- Defaults match
pop_chanevent.m - Safe evaluator with clear errors
3. Import epoch info: dataset cannot be saved afterwards, partial file left on disk (FAIL, high)
- Repro: load
eeglab_data_epochs_ica.set, File > Import epoch info > From MATLAB array or ASCII file, fileepochinfo.txt, fieldsepoch RT cond, latency fieldRT, time unit1E-3, header lines1, Ok, then File > Save current dataset asep_impep.set. - eegprep now: events match EEGLAB exactly (317 events incl. TLE and RT; F22 fixed), but Save as fails with
pop_saveset: Could not convert None (type NoneType) to arrayand leaves an unreadable 369 KBep_impep.setplus.fdt(epout/ep_impep_PARTIAL.set,screenshots/ep_impep_save_error_20261123_025318.png). The main window keeps the old filename. - EEGLAB: new events get
position = [];eeg_checksetbuildsEEG.epoch(k).eventposition = {2, [], [], 2, 2}and the save works. - Root cause (verified Nov 23 by scripting the same call): the
Noneis inEEG.epoch[0]["eventposition"] == [2.0, None, None, 2.0, 2.0], created bysrc/eegprep/functions/adminfunc/eeg_checkset.py:580tmpevent[idx].get(fname, None)when an event lacks a field.pop_saveset.py:559-571writes the.fdtfirst, thenscipy.io.savematraisesTypeError, which neither theValueErrornor theOSErrorhandler catches, so the partial.setstays. - Fix: in
eeg_checkset.py:580use an empty array (MATLAB[]) for a missing field; inpop_savesetmap any remainingNoneto an empty array beforesavemat, write.setand.fdtto temp names in the target folder andos.replacethem only after both succeed, and report a failure aspop_saveset: could not write <file>: field EEG.epoch(1).eventposition holds an unsupported value (...). - Test: scripted pop_importepoch + pop_saveset + pop_loadset round trip; a unit test that forces a savemat failure and asserts no
.set/.fdtremain and the original file (if any) is intact; MATLAB check that the saved set loads in EEGLAB with 317 events. - Save works after Import epoch info, reload equals EEGLAB
- Atomic save, no partial files on any exception type
4. Export > Data and ICA activity to text file scrambles epoched data (FAIL, high)
- Repro: load
eeglab_data_epochs_ica.set(80 epochs), File > Export > Data and ICA activity to text file, defaults (transpose on, labels, time in ms, 4 digits), save, diff against EEGLAB's file. - eegprep now: row 2 (time -992.19 ms) holds sample 1 of epoch 2 (FPz -22.70 where EEGLAB has 14.77); 982,950 of 983,040 values differ (max 532 uV); time column and header are right, so the file looks plausible (
epout/ep_export.txt). Lines end in CRLF on Linux. - EEGLAB:
pop_export.muses MATLABreshape(data, nbchan, pnts*trials)(column-major): epoch 1 samples 1..pnts, then epoch 2. LF line endings. - Root cause:
src/eegprep/functions/popfunc/pop_export.py:60and:64reshape(chan, pnts, trials)in C order;csv.writerdefaultlineterminatoris\r\n. - Fix:
reshape(nbchan, pnts * trials, order="F")in both places (data andexprresult, ICA activations through_selected_data); passlineterminator="\n". - Test: epoched export parity test (byte-compare numbers with an EEGLAB-written reference generated on jamming, or an analytic check that row r equals
data[:, r % pnts, r // pnts]); line-ending test. - Epoched export identical to EEGLAB numbers
- LF endings
5. File > Save current study overwrites an EEGLAB MAT .study with JSON (FAIL, high) and Save current study as writes JSON (MINOR)
- Repro: load the EEGLAB-written
auditstudy_ml.study(MAT 5.0, md5789a4b12), File > Save current study. Then File > Save current study asauditstudy.study, and open both files in EEGLABpop_loadstudy. - eegprep now: the MAT file is replaced in place by JSON text (md5
3ad1a2aa, starts with{;epout/clobbered_auditstudy_ml.study), with no warning; EEGLAB then fails: "STUDY set file not loaded -- check filename and path". Save as also writes JSON. No "Some datasets have been modified, resave them?" prompt. HistorySTUDY = pop_savestudy(STUDY, ALLEEG, filename=..., filepath=...)is Python keyword form. - EEGLAB:
functions/studyfunc/pop_savestudy.m:170-183strips data fields (std_rmalldatafields) and saves withsave('-v6', STUDYfile, 'STUDY')whenoption_saveversion6is 1 (the default,eeg_optionsbackup.m:9), falling back to-v7.3. (The audit text said "MAT v7"; the pin writes v6, i.e. a MAT 5 file.) The resave prompt comes frompop_savestudy.mGUI path. - Root cause:
src/eegprep/functions/studyfunc/pop_savestudy.py:54alwayswrite_json(path, study);docs/source/user_guide/study_workflows.rst:77documents JSON. eegprep's ownpop_loadstudyalready reads MAT studies, so the asymmetry only hurts. - Expected: a
.studyfile written by eegprep opens in EEGLAB. Write a MAT 5.studywithscipy.io.savematusing EEGLAB's STUDY struct layout after the equivalent ofstd_rmalldatafields; keep JSON only when the user asks for it explicitly (e.g.format='json'or a.jsonname); updatestudy_workflows.rst:77; add the modified-datasets prompt; write history as[STUDY ALLEEG] = pop_savestudy( STUDY, ALLEEG, 'filename', 'x.study', 'filepath', '/path');. - Test: round trip eegprep save -> EEGLAB
pop_loadstudyon jamming (2 datasets, names, subjects, task preserved); eegprep save -> eegprep load; resave of an EEGLAB MAT study keeps MAT format; history string test. - Both Save study entries write EEGLAB-readable MAT
- Resave of a MAT study never converts it
- Prompt and MATLAB-form history
B. Medium
6. Neuroscan .CNT: latencies one sample early, first boundary lost (FAIL, medium)
- Repro: File > Import data > ... > From Neuroscan .CNT file,
test.cnt, dialog defaults, Ok, save; compare with neuroscaniopop_loadcnt('test.cnt'). - eegprep now: data identical for samples 1-25600; 25605 samples (EEGLAB reads 3 extra garbage tail samples, -9166 and zeros; eegprep's length is correct: keep it and document it). Events 11 vs 12: the boundary at offset 3737 is missing and every latency is one sample early (5913 vs 5914).
- EEGLAB (neuroscanio 5915f10):
pop_loadcnt.m:150-153builds events with onlytypeandlatency = offset + 1; nodurationfield, so the EEGLABeeg_checkset.m:424-426rule "drop a leading boundary whose duration < 1" never fires. - Root cause (corrected from first principles):
src/eegprep/functions/popfunc/pop_loadcnt.py:129usesoffsetas latency (0-based), andpop_loadcnt.py:130addsduration = 0.0, which makes the faithful port of that EEGLAB rule ineeg_checkset.py:95-98drop the first boundary whenpop_loadcnt.py:57callseeg_checkset(eeg, "eventconsistency").eeg_checksetis right; the importer is wrong. - Fix: latency
offset + 1; leavedurationunset for CNT events (or NaN, matching EEGLAB's struct, then checkeeg_checksettreats it like a missing field); recordEEG = pop_loadcnt('file', 'dataformat', 'auto');-style history; document the 3-sample tail difference as deliberate indocs/source/user_guide/eeglab_migration.rstwith a test. - Test: CNT parity test against neuroscanio: 12 events, identical types and latencies, first boundary at 3738; tail-length documented-difference test.
- 12 events with EEGLAB latencies
- Tail difference documented and tested
7. Neuroscan .EEG goes through pop_fileio: no TLE/RT events (FAIL, medium)
- Repro: File > Import data > ... > From Neuroscan .EEG file,
TESTEEG.EEG, defaults, save; compare with neuroscaniopop_loadeeg. - eegprep now: data identical (maxdiff 0, 32 x 700 x 1200; F119 fixed) but the pop_fileio dialog is shown and the 6000 events are per-trial metadata entries at the epoch start; no time-locking event at 0 and RTs are values instead of events, so epoching/sorting by response cannot work. History
pop_fileio. - EEGLAB: neuroscanio
pop_loadeeg.mdialog (precision, trial/type/electrode/response subsets), 2399 events: oneTLEat time 0 per epoch and anRTevent at the response latency, withaccept/response/epochtypefields; setnameNeuroscan EEG data. - Root cause:
functions/guifunc/menu_actions.py:712-715routes everything unmatched topop_fileio;functions/sigprocfunc/loadeeg.pyexists but there is nopop_loadeegwrapper. - Fix: add
functions/popfunc/pop_loadeeg.py(EEGLAB dialog, TLE/RT events from the sweep headers aspop_loadeeg.mdoes), route.eeg/.EEGto it, historyEEG = pop_loadeeg('file', ...). - Test: parity against neuroscanio on
TESTEEG.EEG: 2399 events, types, latencies, fields; GUI routing test. - pop_loadeeg with EEGLAB dialog and events
8. Magstim/EGI .mff: segments glued, synthetic stim channels added, events thin (FAIL, medium)
- Repro: File > Import data > ... > Import Magstim/EGI .mff file, pick
testmff.mff(segmented, 257 ch, 250 Hz, 2 segments), defaults, save; compare with mffmatlabiopop_mffimport. - eegprep now: 261 ch x 600 continuous: two segments glued and 4 MNE stim channels (
stm+,resp,fbk+,LRND) added as data. EEG channels match to 3.6e-15. 8 events (2ULRNmissing), type/latency/duration only. Historypop_fileio. - EEGLAB: 257 ch x 300 x 2 epochs, xmin -0.202 s, 10 events with
code,label,mffkeys,epoch. - Root cause:
menu_actions.py:712-715routes MFF topop_fileio, which reads through MNEread_raw_egi(adds stim channels, ignores segments). - Fix: add
pop_mffimport(port of mffmatlabio's reader ormne.read_epochs_egifor segmented files) that drops MNE synthetic stim channels, keeps segments as epochs, carries the MFF event keys, and recordsEEG = pop_mffimport('file', ...). - Test: parity against mffmatlabio on
testmff.mff: shape 257 x 300 x 2, xmin, 10 events and fields. - Shape, epochs and events match mffmatlabio
9. BIDS tools > Edit BIDS task info: values never reach the export (FAIL, medium)
- Repro: STUDY
auditstudyloaded, File > BIDS tools > Edit BIDS task info, fill Dataset name, Task name, README, Line frequency 60, Ok; then File > Export > To BIDS. - eegprep now: values stored in
STUDY.etc.bids.taskonly; export still writesPowerLineFrequency: "n/a"anddataset_description.jsonNameEEGPrep export. One scrolling column without*marks; README is a single-line box; a history line is written (EEGLAB writes none). - EEGLAB:
plugins/EEG-BIDS/pop_taskinfo.m:227writesEEG(a).BIDS = bids(tInfo/gInfo) into every dataset and marks it unsaved;pop_taskinfo.m:294-338andpop_exportbidsread them back from the datasets. Quirk: the EEGLAB dialog is taller than a 1200 px screen (Ok/Cancel under the taskbar); eegprep's scrolling layout is the better behaviour to keep. - Root cause:
plugins/EEG_BIDS/bids_tools.py:66-83writes to the target (the STUDY);pop_exportbids.py:210-223_task_inforeads only each dataset'setc.bids.task;pop_exportbids.py:235,246hard-codeEEGPrep export. - Fix: when the target is a STUDY, copy the task section to every ALLEEG entry (and mark them unsaved), or make
_task_infomerge STUDY-level info; useNamefordataset_description.json; multi-line boxes for README/description; mark required fields with*. - Test: pop_taskinfo on a STUDY then pop_exportbids: eeg.json PowerLineFrequency 60, dataset_description Name equals the typed name.
- Task info reaches the exported files
10. BIDS tools > Edit BIDS participant info: single-subject form (FAIL, medium)
- Repro: STUDY
auditstudy(S1, S2), File > BIDS tools > Edit BIDS participant info. - eegprep now: one flat form for one subject (sub-S1); no way to enter S2; no column metadata.
- EEGLAB:
plugins/EEG-BIDS/pop_participantinfo.m: table with one row per participant and columns participant_id/Gender/Age/Group/HeadCircumference/..., plus a BIDS metadata table (Description, Levels, Units), Import column(s), Add/Edit column, Remove column. - Root cause:
bids_tools.py:86-103,143-156pop_participantinfouses the flatpop_participantinfo_dialog_spec. - Fix: QTableWidget dialog with one row per STUDY dataset/subject and the metadata table; store each row in
ALLEEG(k).etc.bids.participant(consumed by_write_participants,pop_exportbids.py:412) and column descriptions forparticipants.json. - Test: GUI renderer test filling two rows; export writes both rows to participants.tsv and descriptions to participants.json.
- Per-participant table and metadata written on export
11. File > Create study > Simple ERP STUDY has no dialog (FAIL, medium)
- Repro: two datasets loaded, File > Create study > Simple ERP STUDY.
- eegprep now: builds
Simple ERP STUDYfrom whatever is loaded (S1/S2, no conditions) at once; user cannot pick files, conditions or subject count. HistorySTUDY, ALLEEG = pop_studyerp(ALLEEG). - EEGLAB:
functions/studyfunc/pop_studyerp.m: memory warning, "Create simple ERP STUDY" dialog (Number of conditions 1, Number of subjects 15), then a subjects x conditions grid of dataset boxes with browse buttons; builds on Ok. - Root cause:
menu_actions.py:978-981callspop_studyerp(self.session.ALLEEG)without GUI. - Fix: port both pop_studyerp dialogs and build only on Ok; MATLAB-form history.
- Test: GUI renderer test: counts dialog, grid, Ok builds the STUDY with the chosen files/conditions; Cancel changes nothing.
- Two dialogs, builds on Ok only
12. File > BIDS tools > BIDS export wizard fails without a loaded dataset (FAIL, medium)
- Repro: no dataset loaded (the menu is enabled in both GUIs), click the item.
- eegprep now: error box
bids_exporter: No current dataset. - EEGLAB:
plugins/EEG-BIDS/bids_exporter.m: "Welcome to the EEG-BIDS exporter tool!" page, Continue opens a file grid (raw file, browse, subject, session, run, condition, group, task) so raw files export without loading. - Root cause:
plugins/EEG_BIDS/bids_tools.py:61-63bids_exporterneedsEEG. - Fix: port the welcome page and the file grid (load each file, apply the grid metadata, call
pop_exportbids); if any part is deferred, disable the item with no dataset and show a tooltip explaining why. - Test: GUI renderer test from an empty session exporting two raw files.
- Wizard works from an empty session
C. Minor (File menu)
13. Export > To BIDS and BIDS tools > Export STUDY to BIDS folder (MINOR, medium)
- Repro: STUDY
auditstudy, File > Export > To BIDS (and File > BIDS tools > Export STUDY to BIDS folder, same callback), defaults, export; diff the tree against EEGLAB's export of the same STUDY; runbids_validator. - eegprep now: no power line prompt (writes
n/a); 17 files vs EEGLAB 19: noparticipants.json, notask-task1_events.json;_run-01on every name;sub-S1_run-01_coordsystem.jsonfails the validator;EEGChannelCount 32with the EOG channels counted as EEG;events.tsvsample column integer (EEGLAB128.0087). channels.tsv types EEG/uV are better than EEGLAB's n/a: keep. - EEGLAB:
pop_exportbids.m:100-112(GUI path) forces a 50/60 Hz choice when PowerLineFrequency is missing;bids_export.m:770-773addsrun-only when a subject has more than one run,:843-846;:840-842writestask-<task>_events.json;:633-writes participants.json;eeg_getchantype.m:60-66infers channel type from the label (EOG1-> EOG), giving EEGChannelCount 30 + EOGChannelCount 2.bids_writeelectrodefile.m:32-49removestask-anddesc-only, so EEGLAB itself would write an invalidrun-coordsystem name for multi-run subjects (EEGLAB quirk). - Root cause:
plugins/EEG_BIDS/pop_exportbids.py:395always appends_run-{run};:509-511_electrode_basenamekeepsrun-;:221,478defaultn/awith no prompt (and the known-difference note at:139only covers the scripted path);:480EEGChannelCount = nbchan;bids_preproc.py:1078-1087counts types only; participants.json and events.json writers missing. - Fix: run entity only when a subject has several datasets (or
forcerun); droprun-(and every entity BIDS disallows) from coordsystem names, documented as a deliberate difference frombids_writeelectrodefile.mwith a test; GUI prompt for power line frequency as EEGLAB; write participants.json and task events.json; count channel types by label aseeg_getchantype.mdoes; keep the integersamplecolumn (BIDS defines it as the onset in samples of the raw file; EEGLABbids_writeeventfile.m:95,113copies the fractionallatency) and document it as a deliberate difference with a test. - Test: export the 2-subject STUDY; assert file list equals EEGLAB's 19 files, validator passes (
bids_validatorpackage), eeg.json counts 30/2, PowerLineFrequency set. - File list and sidecars match EEGLAB, validator clean
14. BIDS tools > Edit BIDS event info is a flat form (MINOR, medium)
- Repro: STUDY loaded, File > BIDS tools > Edit BIDS event info.
- eegprep now: seven text boxes mapping BIDS columns to one string; no Levels/LongName/Description/Units; cannot add a field.
- EEGLAB:
plugins/EEG-BIDS/pop_eventinfo.meditable table (BIDS Field, EEGLAB Field, Levels, LongName, Description, Unit Name, Unit Prefix) with Add/Remove BIDS field. - Root cause:
bids_tools.py:106-119,157-176flatpop_eventinfo_dialog_spec. - Fix: port the table; write its content to
task-<task>_events.jsonon export (ties to item 13). - Test: GUI renderer test editing Levels/Description; exported events.json contains them.
- Table dialog feeding events.json
15. BIDS tools > Validate BIDS dataset misses file-name errors (MINOR, low)
- Repro: File > BIDS tools > Validate BIDS dataset on an eegprep export that contains
sub-S1_run-01_coordsystem.json. - eegprep now: clear message, 0 errors 0 warnings, "sidecar check only", install hints for the official validator.
- EEGLAB: the pin has no bids-validator plugin (menu offers to install it or opens the web validator).
- Root cause:
bids_tools.py:178validate_bidsfallback checks sidecars only. - Fix: in the fallback, also run
bids_validator.BIDSValidator().is_bids()(installed with the extras) on every relative path and report invalid names. - Test: fixture with an invalid coordsystem name produces one error naming the file.
- Fallback flags invalid names
16. Create study > Browse for datasets builds the STUDY with no grid (MINOR, medium)
- Repro: File > Create study > Browse for datasets, pick two .set files.
- eegprep now: multi-file picker then an immediate STUDY (
EEGPrep study, S1/S2, no session/condition/group). Historypop_studywizard(filenames=[...], name=...). - EEGLAB: memory warning, then the
pop_studywizardgrid (row per dataset with browse, subject, session, run, condition, group, task); built on Ok. - Root cause:
menu_actions.py:964-977callspop_studywizard(filenames)without its dialog. - Fix: show the grid prefilled with the picked files; build on Ok; MATLAB-form history.
- Test: GUI renderer test setting condition/group then Ok.
- Grid shown, values applied
17. Create study > Using all loaded datasets: history not runnable (MINOR, low)
- eegprep now: pre-fills S1/S2 so Ok works the first time (EEGLAB errors "All datasets must have a subject name or code" until typed; keep eegprep's friendlier default and document it); no memory warning; history
STUDY, ALLEEG = pop_study(STUDY, ALLEEG, name=..., commands=[...]). - EEGLAB: history
[STUDY ALLEEG] = std_editset( STUDY, ALLEEG, 'name', ..., 'commands', {...}, 'updatedat', 'on' );. - Root cause: Python-kwarg history builders in
functions/studyfunc/(build_python_call, 59 uses). - Fix: EEGLAB-form history for every File-menu STUDY command (pop_study, pop_studywizard, pop_studyerp, pop_loadstudy, pop_savestudy); document the S1/S2 prefill.
- Test: history string tests per command.
- MATLAB-form STUDY history
18. History scripts > Run script cannot run the scripts eegprep saves (MINOR, medium)
- Repro: File > History scripts > Run script on a 5-line EEGLAB
.m(loadset, eegfiltnew 1 Hz, eeg_store, redraw), then the same steps as.py. - eegprep now:
.m: "pop_runscript: EEGPrep can only run Python history scripts" although the picker offers*.mand eegprep's Save history writes only.m..pyworks. - Root cause:
functions/popfunc/pop_runscript.py:21-23;menu_actions.py:1017(save filter*.monly),:1042(run filter*.py *.m *.txt). - Expected: a user can replay what they saved. Offer Save history as
.py(Python calls exist for every command) next to.m, and run.mfiles whose lines are recognisedpop_*/eeg_*calls through the existing history translator, with a clear message listing any line it cannot run. - Test: save history as
.py, run it, dataset equals the original;.mwith supported lines runs; unsupported line gives a message naming the line. - Saved history can be replayed
19. History scripts > Save dataset history script (MINOR, low)
- eegprep now: adds this session's
pop_savesetlines toEEG.history(EEGLAB does not); picker opens in the repo folder; LASTCOM sayspop_saveh(ALLCOM, ...)for the dataset variant. - Root cause:
functions/popfunc/pop_saveh.py:40alwaysALLCOM; saves appended toEEG.historyin the save path. - Fix:
pop_saveh( EEG.history, 'name', 'path');for the dataset variant; start in the dataset folder; stop logging saves intoEEG.history(keep them in ALLCOM). - Test: history strings; EEG.history unchanged by a save.
- Matches EEGLAB file and LASTCOM
20. Save session history script and Load existing dataset: pop_loadset history form (MINOR, low)
- eegprep now:
EEG = pop_loadset('/full/path/file.set');(menu_actions.py:568); session file also writespop_editoptionslines without the leading output. Load error messages are clear and better than EEGLAB's (keep). - EEGLAB:
EEG = pop_loadset('filename', 'file.set', 'filepath', '/path/');. - Fix: EEGLAB form in
menu_actions.py:568and wherever pop_loadset history is built; fix the pop_editoptions line form. Re-check F15 (HDF5 load error) withsample_data/eeglab_data_hdf5.set. - Test: history strings; HDF5 sample loads or gives an actionable message.
- MATLAB-form loadset history; F15 re-checked
21. Manage EEGPrep extensions: empty catalog (MINOR, low)
- eegprep now: lists the 5 bundled extensions;
resources/extension_catalog.jsonhas 0 entries so there is nothing to install and "Copy commands" stays disabled. - Fix: ship a short curated catalog (see
docs/source/user_guide/extension_curation.rst) or state in the dialog that third-party extensions are pip packages and how to find them. - Catalog or explanation shown
22. Export > Events to text file: CRLF (MINOR, low)
- Root cause:
functions/popfunc/pop_expevents.py:38and:81csv writers default to CRLF. Content is identical to EEGLAB. - Fix:
lineterminator="\n". Test: byte compare with EEGLAB output. - LF endings
23. Importers skip pop_newset; ASCII import dialog closes on error (MINOR, low)
- Repro: File > Import data > ... > From ASCII/float file or MATLAB array, Ok with no file; then import
ascii_4x512.txtat 128 Hz. - eegprep now: data identical (maxdiff 0); clear error with no file but the dialog closes; the dataset is stored directly with no pop_newset step (same for BDF/EDF/BIOSIG/CNT/EEG/MFF/BVA). Extra "Auto detect" format and free-text About field.
- EEGLAB: every importer goes through
eeglab_new->pop_newset(name, save as file). - Root cause:
menu_actions.py:685-719calls_store_current_from_gui(new=True)directly. - Fix: route new datasets from importers through the pop_newset dialog; the keep-dialog-open behaviour is shared with Edit/Tools (handled in GUI audit Nov 23: Edit and Tools fixes (DIPFIT co-registration and fine fit, epoched Select data, firpmord, Inspect/label components) #675 item 22, generic inputgui fix), so only wire it here.
- Test: GUI test asserts pop_newset opens after import and its name is applied.
- pop_newset after every import
24. BDF/EDF/BIOSIG interface: options, precision, setname (MINOR, low)
- Repro: File > Import data > ... > From Biosemi BDF file (
test.bdf), From EDF/EDF+/GDF (nepo01.edf), Using the BIOSIG interface. - eegprep now: 41/41 events identical, data within float32 rounding; dialog has 7 options (adds Remove marker channel; lacks force continuous, overflow detection, uncalibrated, mexSLOAD); data float64 in memory; setname is the file stem; comments empty.
- EEGLAB:
pop_biosig.m11 options;eeg_checkset.m:777-779converts to single whenoption_singleis 1; setnameBDF file/EDF file; commentsOriginal file: <path>. - Root cause:
functions/adminfunc/eeg_options.py:22declaresoption_single = 1but nothing applies it;pop_biosig.pysets setname from the file stem. - Fix: either apply
option_single(float32 in memory) or document float64 as deliberate ineeglab_migration.rstand make the preferences dialog say the option has no effect (decision for Suraj/Arno; do not change numeric tolerances); EEGLAB setname and comments; add the missing checkboxes or document them. - Precision decision implemented or documented; setname/comments match
25. Brain Vision Analyzer .mat import: history names an eegprep-only function (MINOR, low)
- eegprep now: data and 16 events identical to bva-io
pop_loadbva; historypop_fileio_brainvision_mat(...); setname "Brain Vision Analyzer file" (EEGLAB empty); float64. - Root cause:
menu_actions.py:696-699. - Fix: expose
pop_loadbvaas the public name and recordEEG = pop_loadbva('file');. - Runnable EEGLAB history
26. Using the FILE-IO interface (MINOR, low)
- eegprep now: dialog has channel/sample/trial range; no data-format popup, no memory-map option, no File/Folder question. Data and 17 events identical; eegprep names the first event
boundary(EEGLAB empty). - Fix: add the data-format popup (auto + explicit formats) for ambiguous extensions; document the boundary naming as deliberate with a test.
- Format popup or documented difference
27. Edit > About this dataset: comments saved as one long row (MINOR, low; lives here because the fix is in pop_saveset)
- Repro:
eeglab_data.set, Edit > About this dataset, add a lineEdited by audit, SAVE, File > Save current dataset as, load the file in EEGLAB. - eegprep now: paragraph breaks kept on screen and in memory (F48 fixed); the saved
.setstorescommentsas one 1x912 char row with embedded newlines, so EEGLAB shows one long row. - EEGLAB:
pop_comments.mstores a padded char matrix (one row per line). - Root cause:
functions/popfunc/pop_saveset.pywrites the string as-is. - Fix: on save, split
commentson newlines into a right-padded char matrix (np.array(lines, dtype='U<n>')); on load, join rows with newlines (checkpop_loadsetalready does). - Test: save/reload round trip; MATLAB check that
size(EEG.comments, 1)equals the line count. - EEGLAB sees one row per line
28. Small follow-ups from PASS rows (File)
- Document in
eeglab_migration.rst: EDF export keeps events as EDF+ annotations and does not pad (EEGLAB adds an event channel and NaN padding, drops annotations); Save as creates a missing folder (EEGLAB errors); Load existing study history is Python form (fix with item 17). - BrainVision
.vhdrimport: add the emptyvisibleevent field for struct parity (optional). - Main window "size" 4.3 vs 4.4 Mb (F4): use EEGLAB's rounding.
D. Not tested in the audit (must be exercised by this PR's retest)
- File > Quit: click in both GUIs with a modified unsaved dataset; prompts and outcome must match EEGLAB.
- File > Import event info > From ERPLAB text files: dialog and Cancel match (EEGLAB still errors on Cancel,
pop_importerplab.mline 93 "Dot indexing", F31: keep eegprep's clean Cancel and document it); import with a real ERPLAB event list + bin file and compare events with EEGLAB.
Global definition of done
- Every checkbox above ticked, or a finding explicitly marked deferred in the PR with Suraj's agreement
- GUI retest side by side with EEGLAB (pin 8ac485f6) of every File-menu item above, same datasets, screenshots attached to the PR
- MATLAB parity on jamming for every numeric item (2, 3, 4, 6, 7, 8, 13) with the scripts committed under
tests/matlab/ - Tests added for every finding; no changes to
tests/fuzz/,tolerances.toml, goldens or parity JSON (only Suraj or Arno change those) - Where EEGLAB has a quirk (CNT tail samples, coordsystem run entity, ERPLAB Cancel, taskinfo dialog height), eegprep does the correct thing, documents it in
eeglab_migration.rst, and a test locks it in - Error messages name the function and the fix; no comments that restate code or justify workarounds
- History lines for File-menu commands are runnable in EEGLAB
Activity
claude commentedon Nov 23, 2026
🤖 Plan:
develop@6b8012cfpop_loadeeg,pop_mffimport, studyerp/studywizard grids, BIDS tables), well over 100 lines → no single PR; split proposal below for human reviewResearch
This is an umbrella issue. I re-checked the main root causes against the current code, and they are accurate:
pop_export.py#L59-L64- C-order reshape scrambles epochs (item 4)pop_chanevent.py#L127,#L216-L223- bool diff = XOR; strict parser (item 2)eeg_checkset.py#L580-Noneinepoch.event*breaks savemat (item 3)pop_loadcnt.py#L129-L130- 0-based latency +duration=0drops first boundary (item 6)pop_savestudy.py#L54- always JSON (item 5);pop_importbids.py#L84-L95- no derivatives save (item 1)Proposed Approach
The issue asks for one PR. I'd advise against that: it would mix core-function changes (which need the MATLAB reference run and human approval) with large GUI ports, and it would run to several thousand lines. Proposed split, in merge order:
order="F"pluslineterminator="\n"in both exporters; cast to float64 before the diff inpop_chanevent, with EEGLAB dialog defaults and a whitelisted AST evaluator forXexpressions;np.array([])instead ofNoneineeg_checkset, plus an atomic temp-file thenos.replacesave inpop_saveset; CNTlatency = offset + 1with noduration. Each one gets a failing test first. About 150-250 lines, so this is a single PR that needs the reference-suite run.pop_importbidswritesderivatives/eeglaband a.study.pop_savestudywrites a MAT 5.studyviasavematafter stripping data fields, and keeps MAT on resave. Add the BIDS-root resave guard and dropreturn_studyfrom history. This is the most urgent group after group 1, because user data is overwritten today.pop_loadset/pop_savehcommands. Removing Python-kwarg history is a deliberate API decision, so please confirm it applies everywherebuild_python_callis used instudyfunc/.participants.json, events.json, channel type counts and the power-line prompt first, then the table dialogs (participant/event info) and thebids_exporterwizard as separate GUI PRs with visual-parity captures.pop_loadeegandpop_mffimportare new features, each with neuroscanio/mffmatlabio parity. Route imports throughpop_newsetafter the GUI audit Nov 23: Edit and Tools fixes (DIPFIT co-registration and fine fit, epoched Select data, firpmord, Inspect/label components) #675 inputgui fix lands.pop_studyerpandpop_studywizardgrids, save and run history as.py, writecommentsas a char matrix.Decisions needed from a maintainer:
option_single(float32 in memory) or document float64 as deliberate?.studystay available via an explicitformat='json', or be removed?.mhistories through a translator (new surface), or only offer.pysave and replay?Once the split is approved I can start group 1 right away (
agent/YYYYMMDD-fix-673-io).Merge origin/develop at f6bea53.
Fix File menu and data I/O audit findings (#673) (#676)
arnodelorme commentedon Dec 1, 2026
🤖 The new pop_importerplab layout finding is tracked in #955. PR #954 includes the actual MATLAB and Qt captures and the same-input numerical comparison.
arnodelorme commentedon Dec 1, 2026
🤖 The new pop_mffimport layout finding is tracked in #1030. PR #1029 includes the actual MATLAB and Qt captures and the same-input numerical comparison.
arnodelorme commentedon Dec 1, 2026
🤖 The new pop_taskinfo GUI finding is tracked in #1049. PR #1048 includes the captures and numerical measurements.
arnodelorme commentedon Dec 1, 2026
🤖 The new pop_eventinfo GUI finding is tracked in #1051. PR #1050 includes the captures and numerical measurements.
arnodelorme commentedon Dec 1, 2026
🤖 The new pop_participantinfo GUI finding is tracked in #1053. PR #1052 includes the captures and numerical measurements.