fields.buffers.core.HDF5Buffer.ones#

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

Create an HDF5-backed buffer filled with ones.

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

  • 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 one-filled HDF5 dataset.

Return type:

HDF5Buffer