lsst.pipe.base  21.0.0-19-g1f131b1+06b35558e6
Classes | Functions
lsst.pipe.base.pipeTools Namespace Reference

Classes

class  MissingTaskFactoryError
 
class  DuplicateOutputError
 
class  PipelineDataCycleError
 

Functions

def isPipelineOrdered (pipeline, taskFactory=None)
 
def orderPipeline (pipeline)
 

Function Documentation

◆ isPipelineOrdered()

def lsst.pipe.base.pipeTools.isPipelineOrdered (   pipeline,
  taskFactory = None 
)
Checks whether tasks in pipeline are correctly ordered.

Pipeline is correctly ordered if for any DatasetType produced by a task
in a pipeline all its consumer tasks are located after producer.

Parameters
----------
pipeline : `pipe.base.Pipeline`
    Pipeline description.
taskFactory: `pipe.base.TaskFactory`, optional
    Instance of an object which knows how to import task classes. It is
    only used if pipeline task definitions do not define task classes.

Returns
-------
True for correctly ordered pipeline, False otherwise.

Raises
------
`ImportError` is raised when task class cannot be imported.
`DuplicateOutputError` is raised when there is more than one producer for a
dataset type.
`MissingTaskFactoryError` is raised when TaskFactory is needed but not
provided.

Definition at line 84 of file pipeTools.py.

◆ orderPipeline()

def lsst.pipe.base.pipeTools.orderPipeline (   pipeline)
Re-order tasks in pipeline to satisfy data dependencies.

When possible new ordering keeps original relative order of the tasks.

Parameters
----------
pipeline : `list` of `pipe.base.TaskDef`
    Pipeline description.

Returns
-------
Correctly ordered pipeline (`list` of `pipe.base.TaskDef` objects).

Raises
------
`DuplicateOutputError` is raised when there is more than one producer for a
dataset type.
`PipelineDataCycleError` is also raised when pipeline has dependency
cycles.  `MissingTaskFactoryError` is raised when TaskFactory is needed but
not provided.

Definition at line 135 of file pipeTools.py.