Skip to content

pop_saveh (File > History scripts > Save dataset or session history script): graphical and numerical parity with EEGLAB #785

Backlog

Description

@suraj-ranganath

EEGPrep checks each EEGLAB function on its own, in one issue, for both the window and the numbers (Arno, November 26, 2026). This issue is pop_saveh, File menu: History scripts > Save dataset or session history script. It stays open until the window and the numbers are both acceptably close to EEGLAB's, even when a pull request is merged or closed.

Findings of the report for this function

Repro on develop (aa81d9ab): Start an empty session, load one tutorial file and save its session history with each suffix. Inspect the recorded save command and the first line of the .py file. Repeat with Save dataset history script.

Done when: All four files identify the right source. Replay session histories in empty workspaces and dataset histories with the starting EEG. Check the samples, dataset selection and operation order. The .py files must parse as Python.

Files

Activity

  1. added
    function-parity
    on Nov 28, 2026
  2. claude commented on Nov 28, 2026

    @claude
    Contributor

    🤖 Plan:

    • Reproduce: GUI session save records pop_saveh(EEG.history, ...); .py files contain MATLAB syntax
    • menu_actions._save_history passes the ALLCOM list (session) or EEG.history (dataset) unchanged
    • pop_saveh writes Python for .py via the console converter (_console_python_command); eegprep.eeglab() redraw only for session history; session .py starts from an empty workspace
    • pop_loadset(filename=..., filepath=...) accepted, so the GUI-recorded load command replays after translation
    • Regression test: both suffixes x both sources, recorded source, command order, .py parses, session replays from an empty workspace and dataset replays from the starting EEG with matching data and channel selection
    • PR [History] Save session history from ALLCOM and write Python for .py scripts #797
    • CI
    • MATLAB reference run (pop_loadset changed); window parity not touched

    Root cause: menu_actions.py L1105-L1112 joined ALLCOM into one string, so pop_saveh.py L40 saw a str and recorded EEG.history. pop_saveh ignored the suffix.

  3. arnodelorme commented on Nov 29, 2026

    @arnodelorme
    Collaborator

    🤖 Pull request [History] Save session history from ALLCOM and write Python for .py scripts is merged into develop, at Arno's request. This issue stays open, by its own rule, until Arno finds the window and the numbers close enough to EEGLAB's.

    What the pull request did. Saving the session history now writes the commands of ALLCOM, and saving the dataset history writes EEG.history. A .py file holds Python, and a .m file is written exactly as EEGLAB writes it. A session .py file ends with a redraw line that shows the datasets the script loaded in the window that is open.

    One difference from EEGLAB, which Arno asked for ("Do not empty ALLCOM"). After running a saved session file, EEGLAB ends with an empty ALLCOM (MATLAB R2025b, on a real session). EEGPrep keeps the commands of the session. This concerns the history list only, no dataset and no number differ.

    What is left.

    • The limits of the converter for Python typed by hand in the console: History converter: Python console lines with escapes or triple quotes, left from #797.
    • A MATLAB transpose in a history line is kept as written in the .py file and is not translated to NumPy. A comment of one word with no semicolon before it (x = 1 % note) is also valid Python and stays as it is.
    • Arno's look at the window and at the saved files, to decide whether this function is done.

    — orchestrator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    function-parity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions