fields.buffers.core.UnytArrayBuffer.full#
- classmethod UnytArrayBuffer.full(shape: Tuple[int, ...], *args, fill_value: Any = 0.0, **kwargs) UnytArrayBuffer [source]#
Create a buffer filled with a constant value and attached units.
This method accepts either scalar values or
unyt_quantity
inputs for fill_value. If aunyt_quantity
is provided, its units are extracted automatically unless overridden by the units keyword.- Parameters:
fill_value (
scalar
orunyt_quantity
, default0.0
) – The value to fill the array with. Units are inferred if fill_value is aunyt_quantity
.*args – Additional arguments passed to
numpy.full()
.**kwargs – Additional keyword arguments passed to
numpy.full()
. May include: - units : str — to override or explicitly declare output units.
- Returns:
A buffer filled with the specified value and tagged with physical units.
- Return type:
- Raises:
TypeError – If the resulting array cannot be coerced into a unyt_array.