Skip to content

Interfaces

rerun

class AsComponents

Bases: Protocol

Describes interface for interpreting an object as a bundle of Components.

Note: the num_instances() function is an optional part of this interface. The method does not need to be implemented as it is only used after checking for its existence. (There is unfortunately no way to express this correctly with the Python typing system, see https://github.com/python/typing/issues/601).

def as_component_batches()

Returns an iterable of ComponentBatchLike objects.

Each object in the iterable must adhere to the ComponentBatchLike interface. All of the batches should have the same length as the value returned by num_instances, or length 1 if the component is a splat., or 0 if the component is being cleared.

class ComponentBatchLike

Bases: Protocol

Describes interface for objects that can be converted to batch of rerun Components.

def as_arrow_array()

Returns a pyarrow.Array of the component data.

Each element in the array corresponds to an instance of the component. Single-instanced components and splats must still be represented as a 1-element array.

def component_name()

Returns the name of the component.