nvalchemi.models.pipeline.PipelineStep#
- class nvalchemi.models.pipeline.PipelineStep(model, wire=<factory>)[source]#
Wraps a model with an output rename mapping.
Only needed when a model’s output key doesn’t match the downstream input key. For models that don’t need renaming, pass the bare model directly — the pipeline normalizes it internally.
- Parameters:
model (BaseModelMixin) – The model to wrap.
wire (dict[str, str]) – Output-to-attribute rename mapping. Each entry
{output_key: data_attribute}causes the pipeline to write the model’soutput_keyvalue ontodata.data_attributebefore downstream models execute. Downstream models that declaredata_attributein theirrequired_inputswill then receive it automatically.
Examples
AIMNet2 produces
"charges"(per-atom partial charges), but the Ewald model expects"node_charges"as a required input:PipelineStep(aimnet2, wire={"charges": "node_charges"})
After AIMNet2 runs, the pipeline writes its
"charges"output ontodata.node_charges. When Ewald runs next, itsadapt_input()findsdata.node_chargesand uses it.If a model’s output keys already match downstream input keys, no wire mapping is needed — pass the bare model:
PipelineGroup(steps=[model_a, model_b]) # auto-wired