Repository navigation
Description
Arno could not load a dataset from the menu File > Load existing dataset on November 27, 2026 (EEGPrep develop at 11743a2, started with uv run --no-sync eegprep-console --full --window-menu-bar): a warning window "pop_loadset: could not read the selected data file" appears and the dataset never shows in the main window.
- Where it stands: reproduced without the window. A dataset saved with an empty name (
EEG.setname = ''in MATLAB) loads withsetnameas an empty 0 by 0 array, and the Datasets menu then fails ondataset.get("setname") or "(no dataset name)"(session.py, line 738). - What is wrong twice:
pop_loadset(oreeg_checkset) should return an empty text field as'', as EEGLAB does, and the warning names the wrong cause (the file was read correctly, the failure is in the menu refresh). - Not yet explained: the three files of EEGLAB's own
sample_datafolder load correctly in a fresh session here, so either the file he picked has no name, or an earlier dataset of that session had none. To be confirmed with him. - Next step: fix at the load (one place), guard the menu line, add a test on a real nameless file, and check the 86 other places that use the same
get(...) orpattern on text fields. - Waits on: the
eegprepworker.
How to reproduce and what was measured
Files of sample_data in the EEGPrep repository that load with setname as an empty array: FlankerTest.set, EmotionValence.set, eeglab_data_tmp.set. The fields subject, group, condition and session come back as empty 0 by 0 arrays for every sample file, including EEGLAB's three.
from eegprep import pop_loadset
from eegprep.functions.guifunc.session import EEGPrepSession
sess = EEGPrepSession()
sess.store_current(pop_loadset("sample_data/eeglab_data_tmp.set"), new=True, command="EEG = pop_loadset(...);")
sess.dataset_summaries()
# ValueError: The truth value of an empty array is ambiguous. Use `array.size > 0` to check that an array is not empty.The same pattern, EEG.get("<text field>") or <default>, appears 86 times under src/eegprep for setname, filename, filepath, subject, group, condition, session and comments (for example pop_newset.py lines 80 and 160, pop_runica.py line 746, pop_headplot.py line 670). Each of them fails the same way on such a dataset, which is why the fix belongs at the load.
The line of session.py dates from May 2026, so the menu line itself is not a recent change.
Arno's message and traceback
"More importantly, it seems I cannot load a file in the EEGPrep version. I type uv run --no-sync eegprep-console --full --window-menu-bar. Then select a dataset file in the menu: "Load dataset." And then get warning and error. I tried the sample dataset file in the sample data folder of EEGLAB."
INFO (eegprep.functions.adminfunc.eeg_checkset) Scaling components to RMS microvolt
INFO (eegprep.functions.adminfunc.eeg_checkset) Scaling components to RMS microvolt
ERROR (eegprep.functions.guifunc.menu_actions) EEGPrep GUI menu action failed: pop_loadset
File ".../guifunc/menu_actions.py", line 598, in _loadset
self._refresh()
File ".../guifunc/main_window.py", line 316, in _dataset_menu_items
summaries = self.session.dataset_summaries()
File ".../guifunc/session.py", line 738, in dataset_summaries
setname = str(dataset.get("setname") or "(no dataset name)")
ValueError: The truth value of an empty array is ambiguous. Use `array.size > 0` to check that an array is not empty.
Part of the File menu test, issue #696.
— orchestrator
Activity
claude commentedon Nov 27, 2026
🤖 Plan:
.setwithsetname = '', thenEEGPrepSession.dataset_summaries()pop_loadsetreturns empty text fields as''Research
The v7 reader keeps MATLAB
''as a 0x0<U1array (matlab_empty), soEEG.get("setname") or ...raises. The v7.3 reader already returns''for these fields (seesample_data/eeglab_data_hdf5.set).src/eegprep/functions/popfunc/_matlab_fields.pymatlab_empty: keeps an empty char as a 0x0 arraysrc/eegprep/functions/popfunc/pop_loadset.py#L77: v7 load pathsrc/eegprep/functions/guifunc/session.py#L738: the menu line that failsProposed Fix
In
pop_loadset, set the EEGLAB text fields (setname,subject,group,condition,comments) to''when they load as an empty array.sessionstays[], as ineeg_emptyset.m.arnodelorme commentedon Nov 27, 2026
🤖 Fix ready in pull request #768 (opened by the automatic agent, reviewed, one commit added by the eegprep worker).
pop_loadsetreturns empty text fields as''.sample_datahave a name and load in a fresh session. On develop, once one nameless dataset is in memory (for exampleeeglab_data_tmp.set,FlankerTest.setorEmotionValence.setof the EEGPrepsample_datafolder of his clone), every later load shows the same warning, EEGLAB's samples included. Reproduced in the real menu on jamming, capture in [EEG] Load empty text fields as empty strings in pop_loadset #768. So the likely cause is a nameless file loaded earlier in the same session. To confirm with him.get(...) oron text fields. They are safe for datasets that come frompop_loadsetnow.