Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.72 KB

README_en.md

File metadata and controls

54 lines (38 loc) · 1.72 KB

中文 English

Background

There has never been a one-stop library for reading mat files in Python. mat5 always relies on scipy.io, mat7.3 always depends on h5py, and reading mat files directly with h5py requires a lot of manual conversion. There is a mat73 converter, but its core logic is written in pure Python, which is very slow.

Coincidentally, there is a library in C called matio, so I wanted to create a binding using pybind11 nanobind.

Installation

pip install pymatio

Example

import pymatio as pm

print(pm.get_library_version())
print(pm.loadmat('file.mat'))

Building from source

Standard build process

git clone https://github.com/myuanz/pymatio
pip install .

Basic dependencies such as zlib and hdf5 will be automatically built cross-platform.

For Windows

Windows usually doesn't come with a built-in build toolchain. You can refer to this page to download the Microsoft C++ Build Tools. Follow the image examples to build the recommended toolchain and click install. Completing this step is sufficient; you don't need to install Rust afterwards.

Roadmap

  • Package as a whl file
  • Add basic tests for successful builds
  • Add cibuildwheel packaging for whl
  • Github Action
  • Automatically handle virtual environments when compiling extensions
  • Complete loadmat
  • Complete savemat
  • Free-threaded whl
  • Import tests from scio and mat73
  • Add types
  • Add benchmarks
    • With scio
    • With mat73
    • With Free-Thread