Skip to content

fix: import mat_struct from the public scipy.io.matlab namespace - #262

Merged
petercorke merged 2 commits into
mainfrom
fix/scipy-mat-struct
Nov 23, 2026
Merged

petercorke merged 2 commits into
mainfrom
fix/scipy-mat-struct

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Fixes bug list item 10. mvtb_load_matfile imported mat_struct from scipy.io.matlab.mio5_params. SciPy deprecates that module and will remove it in SciPy 2.0, and says so in its warning: "Please import mat_struct from the scipy.io.matlab namespace".

  • The import is now from scipy.io.matlab import mat_struct, the public name.
  • The # type: ignore[arg-type] on the isinstance that the private import needed is gone, so mypy now checks that line. The comment that said "scipy private API" is gone too.

Test: mvtb_load_matfile of a file holding a MATLAB struct raises no DeprecationWarning (it failed with the old import). The existing test that a struct becomes a namedtuple is unchanged. mypy reports no issues and the full suite passes (2159 passed, 33 skipped).

AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.

🤖 Generated with Claude Code

mvtb_load_matfile imported mat_struct from scipy.io.matlab.mio5_params, which
SciPy deprecates and will remove in SciPy 2.0. The public name is
scipy.io.matlab.mat_struct, which also lets mypy check the isinstance.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke
petercorke merged commit ae7edef into main Nov 23, 2026
34 checks passed
@petercorke
petercorke deleted the fix/scipy-mat-struct branch November 23, 2026 10:09
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
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.

1 participant