pypi / h5py
h5py
What changed in h5py 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-30.
21 breaking12 new APIs and options3 performance3 behavior and defaults7 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inith5py 346 changes
Breaking changes 21
The deprecated property was removed; use ds[()] to read all data from any dataset.
The broken inherited method was removed because the dimensions interface behaves as a sequence, not a mapping.
The broken inherited method was removed because the dimensions interface behaves as a sequence, not a mapping.
The default mode for opening files is now read-only; specify another mode if you need to write.
The deprecated attribute was removed; use File.id instead.
The deprecated function was removed; see the newer APIs for special types.
The deprecated function was removed; see the newer APIs for special types.
Creating a dataset from a list of bytes objects now uses a variable-length string datatype; use h5py.string_dtype() for fixed-length strings.
The external argument accepts any iterable as its top-level container, bytes or os.PathLike file names, and NumPy integer offsets and sizes; some previous forms are no longer accepted.
Its third argument is now an optional high-level Dataset object rather than a DatasetID.
The deprecated dictionary was removed.
The deprecated module was removed; the high-level API is available directly in the h5py module.
MPI mode no longer supports mpi4py 1.x.
The deprecated function was removed; see the newer APIs for special types.
The deprecated function was removed; see the newer APIs for special types.
h5py now requires Python 3.6 or above and is no longer compatible with Python 2.7.
The command was removed; build configuration can be specified with environment variables instead.
The interface and rules for storing and reading strings have changed and may require changes to existing h5py code.
Variable-length UTF-8 strings in datasets are now read as bytes by default instead of str.
Relative paths are now used for virtual data sources when the source dataset is in the same file as the virtual dataset.
A dtype must now be specified when making a virtual dataset; there is no longer a default dtype.
New APIs and options 12
Reads only selected fields from a dataset with a compound datatype.
Iterates over chunks within the given selection.
Provides the size of a dataset’s data in bytes, unlike size, which gives the number of elements.
File creation now supports setting the file space strategy, including an option to persist empty space tracking between sessions.
The low-level chunk query API provides information about dataset chunks in an HDF5 file.
The low-level chunk query API provides information about dataset chunks in an HDF5 file.
The low-level chunk query API provides information about dataset chunks in an HDF5 file.
Adds allow_unknown_filter for data that will be compressed before writing with the low-level write_direct_chunk() method.
Use a suitable dtype from this API to store fixed-length strings.
Can now be stored and read as HDF5 opaque data, though other tools will not understand them.
Methods accepting a shape tuple, such as dataset creation, now also accept an integer for a 1D shape.
h5py now supports the split file driver.
Performance 3
Selection is implemented in Cython, reducing reading overhead; many small reads from the same dataset can be as much as 10 times faster.
Reading and writing release the GIL so another Python thread can continue during HDF5 access; HDF5’s global lock still prevents faster parallel data access with multithreading.
Writing is more efficient when assigning a scalar to a chunked dataset if the number of elements written is no more than one chunk.
Behavior and default changes 3
Casting data to a specified type on reading can now be used without a with statement.
Now works for any file driver that supports it, not only the sec2 driver.
Virtual datasets can now grow as their source data is resized.
Fixes and other changes 7
obj.attrs can now work on HDF5 stored datatypes.
The property now handles SWMR access modes in addition to plain RDONLY and RDWR modes.
The property is now always available.
Fixed a bug when the source is a high-level object and the destination is a Group.
Now reports storage size of zero bytes without raising an exception.
h5py is now compatible with HDF5 1.12.
When built against HDF5 1.10.6, h5py uses UTF-8 for file names on Windows, allowing all filenames.