Skip to content

daft.functions.hdf5_attrs#

hdf5_attrs #

hdf5_attrs(file_expr: Expression, h5path: str = '/') -> Expression

Read HDF5 attributes for a group or dataset.

Expression wrapper for Hdf5File.attrs(h5path).

Parameters:

Name Type Description Default
file_expr Expression

Hdf5File expression.

required
h5path str

Group or dataset path. Defaults to the root group /.

'/'

Returns:

Type Description
Expression

Expression containing a Python dictionary of attribute names to values.

Source code in daft/functions/hdf5.py
114
115
116
117
118
119
120
121
122
123
124
125
126
def hdf5_attrs(file_expr: Expression, h5path: str = "/") -> Expression:
    """Read HDF5 attributes for a group or dataset.

    Expression wrapper for ``Hdf5File.attrs(h5path)``.

    Args:
        file_expr: ``Hdf5File`` expression.
        h5path: Group or dataset path. Defaults to the root group ``/``.

    Returns:
        Expression containing a Python dictionary of attribute names to values.
    """
    return cast("Expression", hdf5_attrs_fn(file_expr, h5path=h5path))