ftag.hdf5.h5writer#

Classes#

H5Writer

Writes jets to an HDF5 file.

Module Contents#

class ftag.hdf5.h5writer.H5Writer#

Writes jets to an HDF5 file.

dst#

Path to the output file.

Type:

Path | str

dtypes#

Dictionary of group names and their corresponding dtypes.

Type:

dict[str, np.dtype]

shapes#

Dictionary of group names and their corresponding shapes.

Type:

dict[str, tuple[int, …]], optional

jets_name#

Name of the jets group. Default is “jets”.

Type:

str, optional

add_flavour_label#

Whether to add a flavour label to the jets group. Default is False.

Type:

bool, optional

compression#

Compression algorithm to use. Default is “lzf”.

Type:

str, optional

precision#

Precision to use. Default is None.

Type:

str, optional

full_precision_vars#

List of variables to store in full precision. Default is None.

Type:

list[str] | None, optional

shuffle#

Whether to shuffle the jets before writing. Default is True.

Type:

bool, optional

num_jets#

Number of jets to write.

Type:

int | None

dst: pathlib.Path | str#
dtypes: dict[str, numpy.dtype]#
shapes: dict[str, tuple[int, Ellipsis]]#
jets_name: str = 'jets'#
add_flavour_label: bool = False#
compression: str = 'lzf'#
precision: str = 'full'#
full_precision_vars: list[str] | None = None#
shuffle: bool = True#
num_jets: int | None = None#
__post_init__()#
classmethod from_file(source: pathlib.Path, num_jets: int | None = 0, variables=None, **kwargs) H5Writer#
create_ds(name: str, dtype: numpy.dtype) None#
close() None#
get_attr(name, group=None)#
add_attr(name, data, group=None) None#
copy_attrs(fname: pathlib.Path) None#
write(data: dict[str, numpy.ndarray]) None#