Skip to content

Assert setname, event count and icachansind dtype after a sample-data pop_saveset round trip #388

Closed

Description

@arnodelorme

Narrowed 2026-10-15 (develop 796b970f). The original ask is kept below.

Remaining gap

The removed test_pop_saveset_roundtrips_sample_dataset (added in 096f390a) checked four things after pop_saveset → pop_loadset on sample_data/eeglab_data.set:

assert loaded["data"].shape == sample_eeg["data"].shape
assert loaded["setname"] == sample_eeg["setname"]
assert len(loaded["event"]) == len(sample_eeg["event"])
assert np.issubdtype(np.asarray(loaded["icachansind"]).dtype, np.integer)

Current coverage:

  • Data: covered, and more strictly. tests/test_sample_data_pop_functions.py::test_pop_saveset_current_suite_onefile_and_twofiles_roundtrip uses assert_array_equal in onefile and twofiles modes.
  • Event count: only indirect. tests/test_pop_saveset.py::test_saveset_writes_one_based_urevent_after_edit compares the reloaded urevent list after an edit.
  • setname: not asserted after any round trip.
  • Integer icachansind after save → reload: not asserted. test_pop_loadset_loads_eeglab_sample_data_with_core_fields checks it on a fresh load, and test_pop_saveset.py checks the on-disk class is float64.

Fix: add the setname, len(event) and integer-icachansind assertions to test_pop_saveset_current_suite_onefile_and_twofiles_roundtrip (or restore the old test). No MATLAB needed.

Already resolved: the pop_expica half. test_pop_expica_exports_sample_ica_matrices replaces test_pop_expica_exports_sample_ica_weights. It checks exported weights against icaweights @ icasphere and the inverse against icawinv, not just shape and finiteness.


Original issue

🤖 Filed by an agent at @adelorme's request, as post-merge follow-up for the EEGLAB test-port stack (#329–#372).

Two pre-existing tests were removed by the stack and do not appear anywhere under their own names in the merged tree:

Test Original file
test_pop_saveset_roundtrips_sample_dataset tests/test_sample_data_pop_functions.py
test_pop_expica_exports_sample_ica_weights tests/test_sample_data_pop_functions.py

The first is a real .set round-trip check (data shape, setname, event count, icachansind integer dtype); the second checks the exported ICA weight matrix shape and finiteness. Neither was relocated — verified by searching the stack tip for both names.

A third removal, test_pop_writeeeg_exports_sample_through_mne_raw, needs no action: it monkeypatched export_raw, so losing it is consistent with the repo's testing policy. Note this was not a mock cleanup overall — monkeypatch occurrences across tests/ went from 252 to 256.

Ask: restore the two tests, or record here why their removal is correct.

Activity

  1. added
    bug
    on Sep 19, 2026
  2. changed the title [-]Restore two pop function tests removed by the test-port stack[/-] [+]Assert setname, event count and icachansind dtype after a sample-data pop_saveset round trip[/+] on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions