to_hdf5#

caput.mpiarray.MPIArray.to_hdf5(f: str | h5py.File | h5py.Group, dataset: str, create: bool = False, chunks: tuple[int, Ellipsis] | None = None, compression: str | int | None = None, compression_opts: tuple | None = None) None[source]#

Parallel write into a contiguous HDF5 dataset.

Parameters:
fstr | h5py.File | h5py.Group

File to write dataset into.

datasetstr

Name of dataset to write into. Should not exist.

createbool, optional

True if a new file should be created (if needed).

chunkstuple[int, …] | None, optional

Chunk shape.

compressionstr | int | None, optional

Name or identifier of HDF5 compression filter.

compression_optstuple | None, optional

See HDF5 documentation for compression filters. Compression options for the dataset.

Raises:
ValueError

If h5py is built without MPI support and f is not a string.