Parameters

class laminar.components.Parameters(**attributes: Any)

Bases: Layer

Special Layer for handling Flow parameters.

Methods

execute

Execute a layer.

shard

Store each item of a sequence separately so that they may be loaded individually downstream.

Attributes

artifacts

Artifacts assigned to the layer.

attempt

Current layer execution attempt

dependencies

Layers this layer depends on.

hooks

Hooks attached to this layer collated by annotation.

index

Layer index in its splits

name

Name of the Layer

splits

Number of splits in the layer execution

state

State of the Layer

__init__(**attributes: Any)
property artifacts : dict[str, Any]

Artifacts assigned to the layer.

attempt : int | None = None

Current layer execution attempt

configuration : Configuration

Configurations for the Layer

property dependencies : set[str]

Layers this layer depends on.

execute(*parameters: Layer) None

Execute a layer.

Parameters
*parameters

Input layers to the layer.

execution : Execution

Execution the layer is being run in

property hooks : dict[str, set[Callable[[...], Any]]]

Hooks attached to this layer collated by annotation.

index : int | None = None

Layer index in its splits

property name : str

Name of the Layer

shard(**artifacts: Iterable[Any]) None

Store each item of a sequence separately so that they may be loaded individually downstream.

Notes

The artifact that is loaded is of type laminar.configurations.datastores.Accessor.

Usage:

class Task(Layer):
    def __call__(self) -> None:
        self.shard(foo=["a", "b", "c"])
Parameters
**artifacts

Sequence to break up and store.

splits : int | None = None

Number of splits in the layer execution

property state : State

State of the Layer