PipelineBuilder

class lsst.pipe.base.PipelineBuilder(taskFactory, pipeline=None)

Bases: object

PipelineBuilder class is responsible for building task pipeline.

The class provides a set of methods to manipulate pipeline by adding, deleting, re-ordering tasks in pipeline and changing their labels or configuration.

Parameters:
taskFactory : TaskFactory

Factory object used to load/instantiate PipelineTasks

pipeline : Pipeline, optional

Initial pipeline to be modified, if None then new empty pipeline will be created.

Methods Summary

addTask(taskName[, label]) Append new task to a pipeline.
configOverride(label, value) Apply single config override.
configOverrideFile(label, path) Apply overrides from file.
deleteTask(label) Remove task from a pipeline.
labelTask(label, newLabel) Change task label.
moveTask(label, newIndex) Move task to a new position in a pipeline.
pipeline([ordered]) Return updated pipeline instance.

Methods Documentation

addTask(taskName, label=None)

Append new task to a pipeline.

Parameters:
taskName : str

Name of the new task, can be either full class name including package and module, or just a class name to be searched in known packages and modules.

label : str, optional

Label for new task, if None then task class name is used as label.

configOverride(label, value)

Apply single config override.

Parameters:
label : str

Label of the task.

value : str

String in the form "param=value" or "parm.subpar=value", value can be a Python constant or a list of constants.

configOverrideFile(label, path)

Apply overrides from file.

Parameters:
label : str

Label of the task.

path : str

Path to file with overrides.

deleteTask(label)

Remove task from a pipeline.

Parameters:
label : str

Label of the task to remove.

labelTask(label, newLabel)

Change task label.

Parameters:
label : str

Existing label of the task.

newLabel : str

New label of the task.

moveTask(label, newIndex)

Move task to a new position in a pipeline.

Parameters:
label : str

Label of the task to move.

newIndex : int

New position.

pipeline(ordered=False)

Return updated pipeline instance.

Pipeline will be checked for possible inconsistencies before returning.

Parameters:
ordered : bool, optional

If True then order resulting pipeline according to Task data dependencies.

Returns:
pipeline : Pipeline
Raises:
Exception

Raised if any inconsistencies are detected in pipeline definition, see pipeTools.orderPipeline for list of exception types.