Skip to content

hdf5-mojo v0.3.0 is out!

Latest

Choose a tag to compare

@shivasankarka shivasankarka released this 17 Nov 03:07
· 4 commits to main since this release

This release brings the API much closer to h5py: a single create_dataset with keyword options, more dtypes, N-D I/O, and richer attributes and iteration.

Highlights

  • More dtypes: int16, uint16, uint32, uint64, float16. Unsigned 32/64-bit datasets are now identified correctly
    when reopened.
  • h5py-style create_dataset: one call takes fillvalue, chunks, maxshape, compression, compression_opts, shuffle,
    fletcher32 and track_order. The chunk shape is guessed when chunking is implied but chunks is omitted.
    create_dataset_chunked and create_dataset_filtered still work.
  • N-D I/O: readdtype and read_slice now work for any rank, not just 1D/2D. New read_direct and write_direct
    read or write an existing NDArray, for the whole dataset or a List[Slice] selection.
    items(), values() and get_value() via the new AttrValue (as_scalar[dtype], as_array[dtype]).
  • Iteration and ordering: for name in file, for name in group and for name in attrs now work. track_order=True on
    File, create_group and create_dataset lists members and attributes in creation order. The default stays name
    order, like h5py.
  • File: now Copyable, with with File(path, mode) as f: support. It closes when the last copy is destroyed, so a
    forgotten close() no longer leaks the handle.
  • Also: len(dset), Dataset.nbytes(), File.create_dataset_with_data(name, NDArray), and H5Object.group()/dataset()
    work on temporaries.

Fixes

  • read_scalar on an array attribute now raises instead of reading past a one-element buffer.
  • All compiler warnings are fixed in the library, tests and demo.

Requirements: Mojo >=1.2.0,<2, HDF5 >=2.1, NuMojo v0.12.0.

Not yet supported:

  • strings, bool, enum, compound and complex types
  • strided or fancy indexing
  • visit, move, copy and links
  • dimension scales, virtual datasets, SWMR and MPI