Skip to content

[EEG] Load empty text fields as empty strings in pop_loadset - #768

Merged
arnodelorme merged 3 commits into
developfrom
agent/20261127-fix-767
Nov 27, 2026
Merged

arnodelorme merged 3 commits into
developfrom
agent/20261127-fix-767

Conversation

@claude

@claude claude Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

pop_loadset now returns setname, subject, group, condition and comments as '' when a v7 .set stores them as empty arrays, matching eeg_emptyset and the v7.3 reader. A nameless dataset made File > Load existing dataset fail while refreshing the Datasets menu, for that file and for every file loaded after it. The Datasets menu also tolerates a name that is not text, and the warning no longer blames the file read for a later failure.

Fixes #767
Part of #696

A v7 .set saved with setname = '' loaded setname as a 0x0 array, so the
Datasets menu (and other get(...) or default code) raised on truth testing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

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

claude Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @claude[bot]'s task in 33s —— View job


Code review

  • Overall assessment: Looks good. The fix is small. It acts at the loader, where it belongs, and brings the v7 reader in line with eeg_emptyset and the v7.3 reader, which already return '' for empty text fields.
  • Highest-risk area: Restoring the text fields in pop_loadset (src/eegprep/functions/popfunc/pop_loadset.py:88-90).
  • Merge recommendation: Safe to merge.

Blocking

None.

Important

None.

Nits

None.

Test gaps

None. test_pop_loadset_empty_text_fields_load_as_empty_strings saves a dataset with no name, reloads it and lists it through EEGPrepSession.dataset_summaries(). That is the path that broke in #767, where dataset.get("setname") or ... received an empty ndarray. The test checks what users see: the field values and the label in the Datasets menu.

EEGLAB parity notes

None. In eeg_emptyset.m, setname, subject, group, condition and comments all start as '', so turning empty MAT arrays back into '' matches EEGLAB. The normalization runs after _join_comment_matrix, so the handling of multi-line comments is unchanged. It also runs before eeg_checkset, so every loadmode (all, info and channel selection) gets it.

I checked correctness, EEGLAB parity, EEG data structures, test coverage of the change, and compliance with CLAUDE.md and AGENTS.md. I could not run the new test because the runner's tool permissions blocked pytest, so this review comes from reading the code only.

@arnodelorme

Copy link
Copy Markdown
Collaborator

🤖 Review, and one commit added (058b562). The fix at the load is right and small. Issue #767 asked for two more things, which are now on this branch.

  • Datasets menu: dataset_summaries no longer fails on a name that is not text, so a dataset built outside pop_loadset cannot break the menu either. One test in tests/test_console_workspace.py.
  • Warning: the text claimed the file could not be read whenever anything failed after the read. It now says the dataset was not loaded and gives the reason.
  • Checked on a real nameless file: eeglab_data_tmp.set of Arno's sample_data, through the real menu File > Load existing dataset on jamming. On develop the warning appears, and it appears again for every later file, EEGLAB's own eeglab_data_epochs_ica.set included, because the nameless dataset stays in memory. This explains why a file that loads fine in a fresh session failed. With this branch both files load.
  • Lint: the check Ruff and ty fails here because of develop itself (one blank line, fixed by [CI] Add the blank line ruff format expects in the BDF tests #766). Merge [CI] Add the blank line ruff format expects in the BDF tests #766 first.
Before and after, in the real main window (jamming, virtual screen)

load before and after

@arnodelorme
arnodelorme merged commit 02fa1fa into develop Nov 27, 2026
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File > Load existing dataset fails when a dataset has an empty name (setname loads as an empty array)

1 participant