class heparchy.write.HdfWriter(heparchy.write.base.WriterBase)[source]

Create a new heparchy hdf5 file object with write access.

Parameters
path : Path | str

Filepath for output.

compression : Compression | str

Supports “gzip” or “lzf” compression for datasets. Default is gzip.

compression_level : int, optional

Integer between 1 - 9 setting gzip compression factor. Ignored if compression type is lzf. Default is 4.

evts_per_chunk : int

Number of events which should be grouped into a chunk. Grouping the events vastly improves read speed for processes which store large numbers of events, _eg._ 1e+5 or more. Default is 1000.

Examples

Open a new heparchy HDF5 file, and create a process within it:

>>> import heparchy
>>>
>>> with heparchy.write.HdfWriter("showers.hdf5") as hep_file:
>>>     with hep_file.new_process("higgs") as proc:
>>>         ...

Public members

HdfWriter(path: Path | str, ...)[source]

Initialize self. See help(type(self)) for accurate signature.

hepwrite

new_process(name: str) HdfProcessWriter[source]

Returns a context handler object for storage of data in a given hard process.


Last update: Nov 16, 2022