HDF5 bindings v0.2.0 is out! (Mojo v26.2)

Repo: GitHub - shivasankarka/hdf5-mojo: High-level HDF5 bindings for Mojo · GitHub

Updated both ffi and core API with some nice upgrades! This update is focused on making things feel more natural (especially if you’ve used h5py before) and generally easier to work with.

What’s new

  • API updated to be slightly more more h5py-compatible
  • Added NuMojo NDArray as the backend for array ops (finally it’s very easy to work with N-D data!)
  • Reworked HDF5 handle ownership (there were too many UnsafePointers floating around):
    • File now owns HDF5Lib via OwnedPointer
    • Wrappers (groups/datasets/attrs) now carry typed, origin-aware references (This was a good exercise on mojo origin system :slight_smile: which still confuses and surprises me.)
  • UnsafePointer is now only used in raw FFI buffers.
  • Added .get() for access (temporary replacement for __getitem__ while I figure out how to make __getitem__ work seamlessly in all scenarios.)
  • Standardized examples/docs around read[dtype]()
  • Cleaned up some docstring + dtype wording issues.

If you run into anything missing or weird, feel free to open an issue or PR. As always, happy computing!

Also thanks to @duck_tape for his work on pixi-build-mojo, it’s been a life saver in all the projects! :slight_smile:

2 Likes