msl.io.writers.hdf5 module
Writer for the HDF5 file format.
Attention
requires that the h5py package is installed.
- class msl.io.writers.hdf5.HDF5Writer(file=None, **metadata)[source]
Bases:
WriterCreate a HDF5 writer.
You can use
HDF5Writeras a context manager. For example,with HDF5Writer('my_file.h5') as root: root.create_dataset('dset', data=[1, 2, 3])
This will automatically write root to the specified file when the with block exits.
- Parameters:
- write(file=None, root=None, **kwargs)[source]
Write to a HDF5 file.
- Parameters:
file (path-like or file-like, optional) – The file to write the root to. If
Nonethen uses the value of file that was specified whenHDF5Writerwas instantiated.root (
Root, optional) – Write root in HDF5 format. IfNonethen write theGroups andDatasets in thisHDF5Writer.**kwargs – All key-value pairs are passed to
File.