[docs]defpipeline_config_duplicate_node_name_check(cls:type,v:List[Any],field:fields.ModelField)->List[Any]:"""Check if all pipeline nodes have distinct names. Args: cls (type): Class type. v (List[Any]): Value to check. field (fields.ModelField): Field descriptor. Raises: IRISPipelineError: Raised if pipeline nodes aren't unique. Returns: List[Any]: `v` sent for further processing. """node_names=[node.namefornodeinv]iflen(set(node_names))!=len(node_names):raiseIRISPipelineError(f"Pipeline node name must be unique. Received {dict(Counter(node_names))}")returnv
[docs]defpipeline_metadata_version_check(cls:type,v:str,field:fields.ModelField)->str:"""Check if the version provided in the input config matches the current iris.__version__."""ifv!=__version__:raiseIRISPipelineError(f"Wrong config version. Cannot initialise IRISPipeline version {__version__} on a config file "f"version {v}")returnv