MODULE REFERENCE

nodes

anomx.execution.nodes

Node execution shared by the synchronous runner and platform tasks.

Every node type reads its inputs from the JSON-encodable context and writes its output back into it. The platform runs each node in its own task with the context travelling through redis; anomx.execution.runner.JobRunner walks the same executor in-process.

JobRunError

JobRunError

Bases: RuntimeError

Raised when a job or node cannot be executed.

NodeExecution

NodeExecution(node_id: str, node_type: str, status: str, context: dict[str, Any], next_node_ids: list[str] = <factory: list>)

Outcome of executing one node.

Signature parameters
ParameterTypeDefault
node_idstrrequired
node_typestrrequired
statusstrrequired
contextdict[str, Any]required
next_node_idslist[str]<factory: list>

Members

node_idattribute
node_typeattribute
statusattribute
contextattribute
context: dict[str, Any]
next_node_idsattribute
next_node_ids: list[str] = field(default_factory=list)

NodeExecutor

NodeExecutor(*, components: dict[str, Any] | None = None, python_functions: dict[str, Callable[[dict[str, Any]], Any]] | None = None, model_registry: dict[str, Any] | None = None)

Execute job nodes against a shared context.

Components referenced by nodes are resolved from the components registry (key → instance) first, then from dotted import paths. Fitted models stay in model_registry and are referenced from the context via model_ref.

Signature parameters
ParameterTypeDefault
componentskeyword onlydict[str, Any] | NoneNone
python_functionskeyword onlydict[str, Callable[[dict[str, Any]], Any]] | NoneNone
model_registrykeyword onlydict[str, Any] | NoneNone

Members

executemethod
execute(definition: JobDefinition, node_id: str, context: dict[str, Any]) -> NodeExecution
Signature parameters
ParameterTypeDefault
definitionJobDefinitionrequired
node_idstrrequired
contextdict[str, Any]required

Returns NodeExecution

run_python_body

run_python_body(body: str, context: dict[str, Any]) -> dict[str, Any]

Execute user-authored function-body code against the context.

The user only writes the body; it runs inside def __anomx_python_node__(context): ... and may mutate or return the context. Risk assessment of the body is the platform's responsibility before the job is allowed to run.

Signature parameters
ParameterTypeDefault
bodystrrequired
contextdict[str, Any]required

Returns dict[str, Any]