Skip to content

Preserve mixed MATLAB field types and strengthen conversion tests - #437

Merged
suraj-ranganath merged 1 commit into
developfrom
agent/20261007-fix-434
Oct 7, 2026
Merged

suraj-ranganath merged 1 commit into
developfrom
agent/20261007-fix-434

Conversation

@suraj-ranganath

Copy link
Copy Markdown
Member

Make epoched EEG-to-MNE regressions fail instead of skip, and verify mixed-field MATLAB types and values through MAT-file serialization. Fix the exposed py2mat bug that converted numeric fields to text when a later record contained a string, preserving missing-value handling and documenting transport semantics. Validate both tests with deliberate faults and compare against MATLAB and EEGLAB exports.

Fixes #434

@claude

claude Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@suraj-ranganath

Copy link
Copy Markdown
Member Author

🤖 The original tests passed despite py2mat converting numeric 42 to text; strengthened MAT-file checks failed on three record orderings before the fix. Deliberately replacing epoched conversion with a raised error now produces a failure rather than a skip, and deliberately stringifying the mixed fields fails all five type subtests; both temporary faults were removed.

MATLAB R2026a loaded all five corrected MAT-file cases and matched native structs exactly in value and class (int64/double/char as appropriate). Using EEGLAB 420769355b4e754628edfb43da2eb02c72fb8333 to load and save sample_data/eeglab_data_epochs_ica.set, MNE's native-export result and EEGPrep's conversion had identical data (80 epochs × 32 channels × 384 samples), events, times, channel names, and event IDs. EEGLAB's explicit mixed-event-type normalization is distinct from the generic transport preservation checked here.

uv run pytest tests/test_pymat.py tests/test_eeg_eeg2mne.py tests/test_eeglabcompat.py tests/test_pop_saveset.py -q: 13 passed, 5 subtests passed. Required staged pre-commit, changed-file Ruff lint/format, global ty, and Sphinx HTML build (gallery disabled) passed; Sphinx warnings were outside the changed page plus the plot_gallery command-line type warning. CI is pending.

@suraj-ranganath

Copy link
Copy Markdown
Member Author

🤖 Final CI at 8f239b3: Linux Python 3.12/3.13, macOS/Windows Python 3.12, pre-commit, Ruff/ty, and documentation all passed. The automated review failed immediately after initialization with is_error:true and zero model usage, without code findings or an underlying diagnostic cause; tracked in existing Beads issue eegprep-aug. PR remains a draft.

@suraj-ranganath
suraj-ranganath marked this pull request as ready for review October 7, 2026 09:55

@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.

@suraj-ranganath
suraj-ranganath merged commit 40023af into develop Oct 7, 2026
10 of 12 checks passed
@claude

claude Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

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.

[tests] Strengthen weak eeg2mne epoched and py2mat type-consistency tests

1 participant