Layer¶
- class laminar.components.Layer(**attributes: Any)¶
Bases:
object
Task to execute as part of a flow.
Usage:
from laminar import Layer class Task(Layer): ...
Methods
Execute a layer.
Store each item of a sequence separately so that they may be loaded individually downstream.
Attributes
Artifacts assigned to the layer.
Current layer execution attempt
Layers this layer depends on.
Hooks attached to this layer collated by annotation.
Layer index in its splits
Name of the Layer
Number of splits in the layer execution
State of the Layer
Configurations for the Layer
Execution the layer is being run in
- __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.
- 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