fields.buffers.utilities#

Utility functions for working with PyMetric buffer backends.

This module provides high-level entry points to the buffer system, including the buffer_from_array() function which resolves the appropriate buffer class for a given array-like input.

These utilities simplify buffer construction from generic data formats and are recommended for use in user-facing APIs or internal preprocessing steps that must remain backend-agnostic.

Functions

buffer(array, *args[, buffer_class, ...])

Wrap an array-like object in a Pisces buffer instance.

buffer_empty(shape, *args[, buffer_class, ...])

Create a new buffer with uninitialized values.

buffer_empty_like(other, *args, **kwargs)

Create a buffer with uninitialized values, matching the shape of another buffer.

buffer_full(shape, *args[, fill_value, ...])

Create a new buffer filled with a constant value.

buffer_full_like(other[, fill_value])

Create a buffer filled with a constant value, matching the shape of another buffer.

buffer_ones(shape, *args[, buffer_class, ...])

Create a new buffer filled with ones.

buffer_ones_like(other, *args, **kwargs)

Create a buffer filled with ones, matching the shape of another buffer.

buffer_zeros(shape, *args[, buffer_class, ...])

Create a new buffer filled with zeros.

buffer_zeros_like(other, *args, **kwargs)

Create a buffer filled with zeros, matching the shape of another buffer.