fields.buffers.base.BufferBase.ones#

abstract classmethod BufferBase.ones(shape, *args, **kwargs) BufferBase[source]#

Create a new buffer filled with ones.

Constructs a backend-compatible array filled with ones and wraps it in a buffer instance.

Parameters:
  • shape (tuple of int) – The desired shape of the buffer, including both grid and element dimensions.

  • *args – Positional arguments forwarded to the array constructor.

  • **kwargs

    Additional keyword arguments passed to the array constructor. May include:

    • dtype: Data type of the array (e.g., float32, int64)

    • units: Units of the array (if supported)

Returns:

A buffer instance wrapping a one-filled array.

Return type:

BufferBase