Skip to content

[GUI] Remove options with no meaning in Python from Preferences - #719

Merged
arnodelorme merged 3 commits into
developfrom
agent/issue-709
Nov 27, 2026
Merged

arnodelorme merged 3 commits into
developfrom
agent/issue-709

Conversation

@arnodelorme

@arnodelorme arnodelorme commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

File > Preferences no longer shows two-file saving, the save-as-fields switch, the parallel toolbox, memory-mapped arrays, single precision, the EEG object, RMS scaling, Show advanced options, pending plugins, and HTML in graphics. The header of pop_editoptions says why for each. Their keys and defaults stay in EEG_OPTIONS. The list now sits on the EEGLAB blue background, as in every scrolling dialog, and the note on the greyed options is reworded.

Fixes #709
Part of #741

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

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 26, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @arnodelorme's task in 1m 2s —— View job


Code review

  • Overall assessment: The dialog change matches pop_editoptions (Preferences): remove the options with no meaning in Python and say why in the header #709. option_single, option_scaleicarms, option_saveasstruct, and the MATLAB-only options really have no runtime effect, so hiding them is fine. Two of the hidden options, option_savetwofiles and option_memmapdata, are different: EEGPrep still reads both at runtime, and the PR's header, help and docs say they have no meaning.
  • Highest-risk area: saving and loading datasets through the hidden option_savetwofiles and option_memmapdata.
  • Merge recommendation: needs changes.

Blocking

option_savetwofiles and option_memmapdata still change behavior, but no longer have a GUI control (pop_editoptions.py header lines 6–10, pop_editoptions.md lines 10/13, configuration.rst line 104)

  • pop_saveset falls back to savetwofiles_enabled() (pop_saveset.py:777, storage.py:829). pop_loadset falls back to memmap_enabled() (pop_loadset.py:192).
  • Suppose a user turned on two-file saving before this PR. options.json keeps option_savetwofiles=1 and load_eegprep_options restores it on startup. Every later save then writes .set + .fdt with no way to turn it off in Preferences. The new header says "EEGPrep saves a dataset in one file", which is then false.
  • Fix, choose one:
    1. Do what Arno asked in pop_editoptions (Preferences): remove the options with no meaning in Python and say why in the header #709 ("Python should only save the data in one file"): remove the EEG_OPTIONS fallback in pop_saveset/pop_loadset. Explicit savemode="twofiles" and memmap= would keep working. Then update storage.rst, configuration.rst, advanced_topics.rst:198-199, and tests/test_storage.py::test_option_savetwofiles_defaults_to_sidecar_storage. This changes core I/O, so the AGENTS.md MATLAB reference run may apply.
    2. Or keep the runtime behavior and change the reasons to "script-only option, still read by pop_saveset/pop_loadset".

Important

Contradicting docs in configuration.rst. The new paragraph says these options "have no meaning in Python". On the same page, the "Common Global Options" table (L47–52) and L236–238 still describe how option_savetwofiles and option_memmapdata work, and so does storage.rst. The quick-start example still sets EEG_OPTIONS["option_savetwofiles"] = 1 (L19). Make these pages match the fix you choose above.

Nits

None.

Test gaps

  • If you choose fix 1, replace test_option_savetwofiles_defaults_to_sidecar_storage with a test that saves with EEG_OPTIONS["option_savetwofiles"]=1 and checks that only one file is written (no .fdt).
  • If you choose fix 2, no new test is needed.

EEGLAB parity notes

Dropping these controls is an EEGPrep decision Arno made in #709, and pop_editoptions.py's header documents it. That is fine as a GUI deviation from EEGLAB's pop_editoptions.m. Two smaller checks came out fine:

  • The section headers still line up after the move: "EEGPrep connectivity and support" now sits on option_boundary99, and the empty "Memory options" header is gone.
  • The test assertion that saveasstruct and scaleicarms still save as 1 matches eeg_options.py.

Checked for correctness bugs, EEGLAB parity, data structure compatibility, changed-behavior tests, and CLAUDE.md/AGENTS.md compliance. I posted two inline comments.

Comment on lines +6 to +10
- ``option_savetwofiles``: EEGPrep saves a dataset in one file.
- ``option_saveasstruct``: dataset fields are always saved as individual
variables (the EEGLAB 2021 format), with no switch to undo it.
- ``option_parallel``: it drives MATLAB's parallel toolbox.
- ``option_memmapdata``: memory-mapped arrays are not a preference in Python.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocking: these two reasons are wrong. Both options still change runtime behavior:

This is also a regression for users. If someone turned on two-file saving before this PR, options.json still has option_savetwofiles=1 and load_eegprep_options restores it. Every later save then writes two files, and the GUI no longer has a control to turn that off.

Pick one of these fixes:

  1. Do what pop_editoptions (Preferences): remove the options with no meaning in Python and say why in the header #709 asks ("Python should only save the data in one file"): make pop_saveset stop reading option_savetwofiles and make pop_loadset stop reading option_memmapdata. Explicit savemode="twofiles" and memmap= would still work. Then update storage.rst, configuration.rst (lines 19, 29, 47-52, 236-238), and tests/test_storage.py::test_option_savetwofiles_defaults_to_sidecar_storage. That changes pop_saveset/pop_loadset, so check whether this counts as a core change.
  2. Or keep the runtime behavior and change the reasons here, in pop_editoptions.md, and in configuration.rst to say these are script-only options that still work through EEG_OPTIONS.

Comment on lines +103 to +109
Preferences leaves out the EEGLAB options that have no meaning in Python:
two-file saving (EEGPrep saves a dataset in one file), the switch for saving
fields as individual variables (always on), the parallel toolbox, memory-mapped
arrays, single precision, the EEG object, RMS scaling of ICA activities (always
on), Show advanced options, plugins pending approval, and HTML in graphics.
Their keys stay in ``EEG_OPTIONS`` with their defaults, so EEGLAB scripts and
saved option files still load.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important: this paragraph contradicts the same page. The "Common Global Options" table (L47-L52) and L236-L238 still say option_savetwofiles and option_memmapdata change how pop_saveset and pop_loadset behave, and they do. storage.rst says the same. Make all of these pages agree with whichever fix you choose for the blocking comment on pop_editoptions.py.

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

🤖 Captures: EEGLAB, EEGPrep before and EEGPrep after, taken on jamming under a virtual screen. The list now sits on the blue background and the note on the greyed options is reworded.

Preferences window

Preferences window

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

The review bot found that two options removed from the Preferences window, two-file saving and memory-mapped loading, were still read by pop_saveset and pop_loadset, so an old options.json with two-file saving turned on would keep writing a .set and a .fdt with no way to switch it off.

Following Arno's words in #709 ("Python should only save the data in one file. So no more two-file options ... Memory map array is irrelevant"), commit 0775cd1 makes pop_saveset stop reading option_savetwofiles and pop_loadset stop reading option_memmapdata. Asking explicitly still works: savemode="twofiles" writes a .fdt sidecar and memmap=True maps it, and a dataset loaded from a .set and .fdt pair still keeps its two files when saved again. The header of pop_editoptions, its help page, the pop_saveset and pop_loadset help, configuration.rst, storage.rst, advanced_topics.rst and the changelog now say the same thing. The old test is replaced by one that turns both options on and checks that only one .set file is written.

Tests: 149 passed and 2 skipped in test_storage, test_stream11_preferences, test_file_menu_audit_673, test_mmo_eeglab_tests and the pop_saveset and pop_loadset tests; the one failure (test_real_testmff_matches_eeglab_epochs) also fails before this change because the local environment lacks defusedxml. This touches core file input and output, so the EEGLAB reference run is needed before merging; it was started on this branch: https://github.com/sccn/eegprep/actions/runs/45951295256

— orchestrator

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.

pop_editoptions (Preferences): remove the options with no meaning in Python and say why in the header

1 participant