Skip to content

Container

hexa.container

Summary

Container to build a wired hexa pipeline from annotations.

Functions

build

1
2
3
4
5
6
build(
    cls: type[T],
    *,
    instances: dict[str, Any] | None = None,
    config: dict[str, Any] | None = None
) -> T

Recursively instantiate the port tree from annotations.

Parameters

cls : type The root class to build (e.g. AxisExtractionPipeline). instances : dict, optional {slot_name: object} injected verbatim into every node whose annotations contain that name (runtime values — repos, handlers, clients — that must not be re-constructed). Applied to the whole tree by name. config : dict, optional {field_name: value} propagated by name to every node's annotated config fields (non-port attributes), replacing the default None.

Returns

instance A fully wired instance of cls and all its nested ports.