with_read_hdf5#

gwpy.io.hdf5.with_read_hdf5(
func: Callable[Concatenate[Readable | h5py.HLObject, P], R],
) Callable[Concatenate[h5py.HLObject, P], R][source]#

Decorate an HDF5-reading function to open a filepath if needed.

The decorated function will accept file paths or readable objects, but will always pass an h5py.Group as the first argument to the original function.

Parameters:
funccallable()

Function that expects an h5py.Group as its first argument

Returns:
callable()

Decorated function that accepts file paths/readable objects