nirs4all.pipeline.storage.artifacts.operator_chain module

Operator Chain - V3 artifact identification system.

This module provides the core data structures for the V3 artifact system: - OperatorNode: Represents a single operator in the execution path - OperatorChain: Full path of operators that produced an artifact

The Operator Chain is the fundamental identifier for any artifact. It encodes the complete chain of operators that produced the artifact, enabling: - Complete chain tracking from input to output - Deterministic replay of any execution path - Unified handling of branching, multi-source, and stacking

Chain Path Format:

“s{step}.{ClassName}[br={branch},src={source}]>s{step}.{ClassName}[…]”

Examples

  • “s1.MinMaxScaler[src=0]” - Single transformer at step 1, source 0

  • “s1.MinMaxScaler>s3.SNV[br=0]>s4.PLS[br=0]” - Chain through branch 0

  • “s4.PLS[br=0]+s4.RF[br=1]>s5.Ridge” - Meta-model combining branches

nirs4all.pipeline.storage.artifacts.operator_chain.parse_artifact_id_v3(artifact_id: str) → tuple[str, str, int | None][source]

Parse V3 artifact ID into components.

Parameters:

artifact_id – V3 artifact ID string

Returns:

Tuple of (pipeline_id, chain_hash, fold_id)

Raises:

ValueError – If format is invalid

Examples

>>> parse_artifact_id_v3("0001_pls$a1b2c3d4e5f6:all")
('0001_pls', 'a1b2c3d4e5f6', None)
>>> parse_artifact_id_v3("0001_pls$a1b2c3d4e5f6:0")
('0001_pls', 'a1b2c3d4e5f6', 0)