nirs4all.pipeline.dagml.operator_routing module
Operator-routing registry: dag-ml graph node → real nirs4all/sklearn operator.
Phase 2a lowers a live pipeline to compat DSL; the compiler turns each step into a graph node carrying an operator ref + params. This module inverts that for execution: given a node it instantiates the concrete operator a host controller fits/transforms/predicts with. Mechanism-independent — both the CLI process-adapter and an in-process callback route the same way.
The operator ref shape differs by node kind (verified against the compiled vertical slice):
transform—{"class": "<FQN>"}; params live on the node.y_transform—{"class": "<FQN>", "params": {...}}; params live on the operator.model— a bare short name string ("PLSRegression"); params on the node.
Transforms/y_transforms carry a fully-qualified class resolved by import; models carry a
short name resolved through an explicit allow-table (short names are ambiguous across
modules, so silent fuzzy resolution is refused). The transform-vs-target distinction is
the node kind, never the class — a bare scaler is an X transform, a y_processing
scaler is a target transform.
- nirs4all.pipeline.dagml.operator_routing.route_operator(operator_kind: str, operator_ref: str, params: dict[str, Any] | None = None, *, variant_overrides: dict[str, Any] | None = None) object[source]
Instantiate the operator for one node.
- Parameters:
operator_kind –
transform|y_transform|model.operator_ref – a fully-qualified class (transform/y_transform) or a short model name (model).
params – operator constructor params.
variant_overrides – per-variant params that win over
params(generator sweeps).