22 """Module defining Pipeline class and related methods. 25 __all__ = [
"Pipeline",
"TaskDef"]
45 """TaskDef is a collection of information about task needed by Pipeline. 47 The information includes task name, configuration object and optional 48 task class. This class is just a collection of attributes and it exposes 49 all of them so that attributes could potentially be modified in place 50 (e.g. if configuration needs extra overrides). 55 `PipelineTask` class name, currently it is not specified whether this 56 is a fully-qualified name or partial name (e.g. ``module.TaskClass``). 57 Framework should be prepared to handle all cases. 58 config : `lsst.pex.config.Config` 59 Instance of the configuration class corresponding to this task class, 60 usually with all overrides applied. 61 taskClass : `type` or ``None`` 62 `PipelineTask` class object, can be ``None``. If ``None`` then 63 framework will have to locate and load class. 64 label : `str`, optional 65 Task label, usually a short string unique in a pipeline. 67 def __init__(self, taskName, config, taskClass=None, label=""):
76 rep +=
", label=" + self.
label 82 """Pipeline is a sequence of `TaskDef` objects. 84 Pipeline is given as one of the inputs to a supervising framework 85 which builds execution graph out of it. Pipeline contains a sequence 86 of `TaskDef` instances. 88 Main purpose of this class is to provide a mechanism to pass pipeline 89 definition from users to supervising framework. That mechanism is 90 implemented using simple serialization and de-serialization via 91 `pickle`. Note that pipeline serialization is not guaranteed to be 92 compatible between different versions or releases. 94 In current implementation Pipeline is a list (it inherits from `list`) 95 and one can use all list methods on pipeline. Content of the pipeline 96 can be modified, it is up to the client to verify that modifications 97 leave pipeline in a consistent state. One could modify container 98 directly by adding or removing its elements. 102 pipeline : iterable of `TaskDef` instances, optional 103 Initial sequence of tasks. 106 list.__init__(self, iterable
or [])
109 """Return task index given its label. 119 Task index, or -1 if label is not found. 121 for idx, taskDef
in enumerate(self):
122 if taskDef.label == label:
127 infos = [str(tdef)
for tdef
in self]
128 return "Pipeline({})".format(
", ".join(infos))
def __init__(self, taskName, config, taskClass=None, label="")
def __init__(self, iterable=None)
def labelIndex(self, label)