fields.buffers.core.HDF5Buffer.full#

classmethod HDF5Buffer.full(shape: ~typing.Tuple[int, ...], *args, fill_value: ~typing.Any = 0.0, dtype: ~typing.Any = <class 'float'>, **kwargs) HDF5Buffer[source]#

Create an HDF5-backed buffer filled with a constant value or quantity.

Parameters:
  • shape (tuple of int) – Desired shape of the dataset.

  • fill_value (scalar, array-like, or unyt_quantity, default 0.0) – Value to initialize the dataset with. Can be: - A plain scalar (e.g., 3.14) - A NumPy array or similar array-like object - A unyt_quantity with units

  • dtype (data-type, default float) – Element type of the dataset.

  • *args – Additional positional arguments passed to create_dataset.

  • **kwargs

    Keyword arguments forwarded to create, such as:

    • parent : h5py.File or h5py.Group

    • dataset_name : str

    • overwrite : bool

Returns:

A buffer wrapping a constant-filled HDF5 dataset.

Return type:

HDF5Buffer