fields.buffers.base.BufferBase.full#

abstract classmethod BufferBase.full(shape, *args, fill_value=0.0, **kwargs) BufferBase[source]#

Create a new buffer filled with a constant value.

This method builds a backend-specific array of the given shape and fills it with the provided fill_value. The resulting array is wrapped and returned as a buffer instance.

Parameters:
  • shape (tuple of int) – The desired shape of the buffer (grid + element dimensions).

  • *args – Additional positional arguments passed to the backend constructor.

  • fill_value (float, default 0.0) – The constant value to use for every element in the array.

  • **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 constant-filled array.

Return type:

BufferBase