Skip to content

ENH: Replace custom _whosmat_hdf5 with pymatreader.whosmat#13753

Merged
larsoner merged 5 commits intomne-tools:mainfrom
bruAristimunha:remove-whosmat-hdf5-use-pymatreader
Apr 3, 2026
Merged

ENH: Replace custom _whosmat_hdf5 with pymatreader.whosmat#13753
larsoner merged 5 commits intomne-tools:mainfrom
bruAristimunha:remove-whosmat-hdf5-use-pymatreader

Conversation

@bruAristimunha
Copy link
Copy Markdown
Contributor

@bruAristimunha bruAristimunha commented Mar 14, 2026

Summary

  • Remove custom _whosmat_hdf5 function (~98 lines) and delegate to pymatreader.whosmat (available since v1.2.2), which handles all MATLAB file versions including v7.3 (HDF5)
  • Pin pymatreader >= 1.2.2 in pyproject.toml and propagate to environment.yml
  • Add min_version="1.2.2" to _import_pymatreader_funcs and _check_pymatreader_installed

Closes #13752

Test plan

  • python -c "from mne.io.eeglab._eeglab import _readmat" — import succeeds
  • python -m pytest mne/io/eeglab/tests/test_eeglab.py -x — no failures
  • CI: EEGLAB tests with pymatreader installed pass
  • CI: FieldTrip and ICA pymatreader tests unaffected

Remove the custom _whosmat_hdf5 function and delegate to
pymatreader.whosmat (available since v1.2.2), which handles
all MATLAB file versions including v7.3 (HDF5). Pin
pymatreader >= 1.2.2 accordingly.
Since pymatreader.whosmat was only released ~2 weeks ago (v1.2.2),
it's too recent to require as a minimum version. Move the custom
_whosmat_hdf5 implementation to mne/fixes.py and add a _whosmat
wrapper that tries pymatreader.whosmat (>= 1.2.2) first, falls back
to scipy.io.whosmat, then to the custom h5py-based reader.

Revert min_version="1.2.2" requirements from check.py, pyproject.toml,
and environment.yml.
@larsoner larsoner enabled auto-merge (squash) April 3, 2026 05:18
@larsoner larsoner added this to the 1.12 milestone Apr 3, 2026
Updated the description of the changes related to MATLAB v7.3 file inspection.
@larsoner larsoner merged commit 678d4d3 into mne-tools:main Apr 3, 2026
32 checks passed
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.

[EHN] Remove the whosmat to use the new functionally avaliable at pymatreader

2 participants