Repository navigation
pop_newset: Show the correct storage options for saved and modified datasets - #1016
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.
|
Claude finished @arnodelorme's task in 59s —— View job Code review
BlockingNone. Important
Nits
Test gapsNone. The parametrized GUI test covers both saved states, checks the prefilled old filename and the enable toggle, and confirms the file is written and the history command is recorded. EEGLAB parity notes
Checked: correctness of the new |
| if is_on(result.get("saveold")) and result.get("oldfile"): | ||
| gui_options["saveold"] = str(result["oldfile"]) |
There was a problem hiding this comment.
Important: a checked "Save it as file" with an empty filename is silently ignored
eegprep/src/eegprep/functions/popfunc/pop_newset.py
Lines 230 to 234 in 1df9fcd
oldfile is pre-filled from _dataset_filename(previous) (L173). A recording that was never written to disk has no filename, so the field starts empty. The PR measurements used this ordinary in-memory workflow. If the user ticks the old-dataset "Save it as file" box, leaves the field empty and also ticks Overwrite, saveold is dropped here. The old recording is then replaced in memory without being saved and without an error, which loses the user's unsaved changes.
Suggested fix: handle this the same way as savenew on L231. An empty field then becomes "on", and _save_existing_datasets raises saveold requires the existing dataset to have filename and filepath instead of discarding the request:
| if is_on(result.get("saveold")) and result.get("oldfile"): | |
| gui_options["saveold"] = str(result["oldfile"]) | |
| if is_on(result.get("saveold")): | |
| gui_options["saveold"] = str(result.get("oldfile") or "on").strip() or "on" |
arnodelorme
left a comment
There was a problem hiding this comment.
This review was written by an AI assistant during a nightly check, not by Arno.
Code review
- Overall assessment: Needs changes for two GUI workflow gaps (
STUDYforwarding from GUI actions andCURRENTSETlist handling inpop_newset). - Highest-risk area:
STUDYforwarding insrc/eegprep/functions/guifunc/menu_actions.pyandsrc/eegprep/functions/popfunc/pop_newset.py, plusCURRENTSETlist handling when dataset 1 has unsaved changes. - Merge recommendation: Needs changes.
Blocking
None.
Important
-
Important (
src/eegprep/functions/guifunc/menu_actions.py_commit_processed_dataset_from_gui,src/eegprep/functions/popfunc/pop_newset.py_command_options,docs/source/user_guide/eegbrowser.rst):
pop_newset_dialog_specand_run_guiaddstudyhandling (andeegprep/src/eegprep/functions/popfunc/pop_newset.py
Lines 138 to 153 in fc14164
), andeegprep/src/eegprep/functions/popfunc/pop_newset.py
Lines 205 to 212 in fc14164
docs/source/user_guide/eegbrowser.rst() states that rejecting marked data from the GUI menu openseegprep/docs/source/user_guide/eegbrowser.rst
Lines 106 to 111 in fc14164
pop_newsetwith overwriting checked when aSTUDYis active. However,MenuActionDispatcher._commit_processed_dataset_from_gui() only passeseegprep/src/eegprep/functions/guifunc/menu_actions.py
Lines 1916 to 1926 in fc14164
"study": int(bool(self.session.STUDY))whenisinstance(eeg, list). Wheneegis a singledict(all GUI menu actions and EEGBrowser rejections that open the dialog),"study"is omitted, sooptions.get("study", False)is alwaysFalse. Even when aSTUDYis active, theSTUDYprompt is never shown, andoverwritestays unchecked and enabled (unlike EEGLABeeglab.mL515 andeeglab_new.mL52, which always pass'study', ~isempty(STUDY)+0).
Suggested fix: pass"study": int(bool(self.session.STUDY))in thedictbranch of_commit_processed_dataset_from_guias well, and drop"study"from_command_options() so history strings for one dataset match EEGLABeegprep/src/eegprep/functions/popfunc/pop_newset.py
Lines 312 to 318 in fc14164
pop_newset.mL567 without adding'study', 0or'study', 1(retrieveandisinstance(EEG, list)already handle"study"on L48 and L73). -
Important (
src/eegprep/functions/popfunc/pop_newset.pypop_newsetL51 to L55):
pop_newsetresolvesprevioususing_first_currentset(CURRENTSET)() even wheneegprep/src/eegprep/functions/popfunc/pop_newset.py
Lines 51 to 55 in fc14164
CURRENTSETselects multiple datasets (for example[1, 2]beforeEdit > Append datasets/pop_mergeset, which commits one mergeddict). In MATLAB EEGLAB (functions/popfunc/pop_newset.mL215),saved = 0andfilenameoldare only set whenlength(OLDSET) == 1. Here, if dataset 1 hassaved == "no"whileCURRENTSET == [1, 2], the dialog displays thesaveoldrow prefilled with dataset 1's path, and checkingsaveoldmakes_save_existing_datasets() raiseeegprep/src/eegprep/functions/popfunc/pop_newset.py
Lines 278 to 279 in fc14164
ValueError: saveold with multiple datasets requires each dataset to have filename metadata.
Suggested fix: only resolvepreviouson L52 and L53 whenCURRENTSETrefers to one dataset (not alistortuplewithlen(CURRENTSET) > 1), matchingpop_newset.mL215.
Nits
None.
Test gaps
- Add a GUI session test verifying that committing one processed dataset when
session.STUDYis active openspop_newsetwith theSTUDYprompt andoverwritechecked and disabled, without adding'study'to the history string. - Add a
pop_newsetGUI test withCURRENTSET=[1, 2]andalleeg[0]["saved"] == "no"verifying that thesaveoldrow is not shown.
EEGLAB parity notes
- Checked against
functions/popfunc/pop_newset.m(L211 to L336 and L428 to L567),eeglab.m(L515), andeeglab_new.m(L52). - When
CURRENTSETselects one dataset, the three prompts for the old dataset, thesuperguirow geometry, thesaveoldrow visibility (saved == "no"only, treating"justloaded"and"yes"as unmodified), and theoverwritedefaults (studyorprevious_modified and storedisk_enabled()) matchpop_newset.mCases 6 through 9. - Under Case 7 (
~saved && option_storedisk,pop_newset.mL268 to L288), MATLAB blocks unchecking bothoverwriteandsaveoldinside the dialog, whereas EEGPrep raisesRuntimeError: Cannot offload unsaved dataset 1ineeg_storeif the user unchecksoverwritewithout checkingsaveold. That fails explicitly without losing unsaved changes. - Tests run in a detached worktree at
fc14164253428628f25cc3357be14bbf7c0fb7d1:tests/test_pop_newset.py(11 passed),tests/test_eeg_store_storedisk.py(4 passed), andtests/test_stream3_scroll_window.py -k newset(2 passed), plus direct Python reproduction of both findings above.
arnodelorme
left a comment
There was a problem hiding this comment.
This review was written by an AI assistant during a nightly check, not by Arno.
Code review
- Overall assessment: Looks good.
- Highest-risk area: None identified.
- Merge recommendation: Safe to merge.
Blocking
None.
Important
None.
Nits
None.
Test gaps
None.
EEGLAB parity notes
- Checked against
functions/popfunc/pop_newset.m(L211 to L336 and L428 to L567) andeeglab.m(L515). - Both findings from the prior review on
fc14164253428628f25cc3357be14bbf7c0fb7d1are resolved:MenuActionDispatcher._commit_processed_dataset_from_guiforwardsstudyfor single datasets while_command_optionsomitsstudyfrom single dataset history commands (matchingpop_newset.mL567), andpop_newsetonly resolvespreviouswhenCURRENTSETrefers to one dataset (matchingpop_newset.mL215). - Prompts,
superguirow geometry,saveoldrow visibility (saved == "no"only), andoverwritedefaults (studyorprevious_modified and storedisk_enabled()) matchpop_newset.mCases 6 through 9. - Tests run in a detached worktree at
036a26fd2e33d837fbaf4f3f797eff144b195dd4:tests/test_pop_newset.py(12 passed),tests/test_eeg_store_storedisk.py(4 passed),tests/test_gui_main_window.pyfiltered onnewset or commit_processed_dataset or transform_action(4 passed),tests/test_stream3_scroll_window.pyfiltered onnewset(2 passed), andruff checkplusruff formatcheck on the modified Python files (all passed).
Checked for correctness bugs, EEGLAB parity, data structure compatibility, changed behavior tests, and CLAUDE.md/AGENTS.md compliance.
🤖 Part of #938 and #875. Show the correct storage options for saved and modified datasets. Stacked on #974.
Native measurements and validation
With a saved previous dataset the native windows both measure 247 px high. With unsaved changes both measure 273 px, showing an extra filename row that can actually save the previous recording. The largest vertical displacement across both cases was 0.49 px. A native edit, rename and store returned identical samples and metadata when creating a new dataset and when replacing the current dataset. All 10 focused tests passed, including a test writing and reading the requested previous-dataset file. The measured cases used the ordinary in-memory dataset workflow.
Full inventory report for the project team. pop_newset (p. 97). PDF · Editable Word.