LSST Applications  22.0.1,22.0.1+01bcf6a671,22.0.1+046ee49490,22.0.1+05c7de27da,22.0.1+0c6914dbf6,22.0.1+1220d50b50,22.0.1+12fd109e95,22.0.1+1a1dd69893,22.0.1+1c910dc348,22.0.1+1ef34551f5,22.0.1+30170c3d08,22.0.1+39153823fd,22.0.1+611137eacc,22.0.1+771eb1e3e8,22.0.1+94e66cc9ed,22.0.1+9a075d06e2,22.0.1+a5ff6e246e,22.0.1+a7db719c1a,22.0.1+ba0d97e778,22.0.1+bfe1ee9056,22.0.1+c4e1e0358a,22.0.1+cc34b8281e,22.0.1+d640e2c0fa,22.0.1+d72a2e677a,22.0.1+d9a6b571bd,22.0.1+e485e9761b,22.0.1+ebe8d3385e
LSST Data Management Base Package
Public Member Functions | Public Attributes | List of all members
lsst.pipe.base.graphBuilder.GraphBuilder Class Reference
Inheritance diagram for lsst.pipe.base.graphBuilder.GraphBuilder:

Public Member Functions

def __init__ (self, registry, skipExisting=True)
 
def makeGraph (self, pipeline, collections, run, userQuery)
 

Public Attributes

 registry
 
 dimensions
 
 skipExisting
 

Detailed Description

GraphBuilder class is responsible for building task execution graph from
a Pipeline.

Parameters
----------
registry : `~lsst.daf.butler.Registry`
    Data butler instance.
skipExisting : `bool`, optional
    If `True` (default), a Quantum is not created if all its outputs
    already exist.

Definition at line 791 of file graphBuilder.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.base.graphBuilder.GraphBuilder.__init__ (   self,
  registry,
  skipExisting = True 
)

Definition at line 804 of file graphBuilder.py.

804  def __init__(self, registry, skipExisting=True):
805  self.registry = registry
806  self.dimensions = registry.dimensions
807  self.skipExisting = skipExisting
808 

Member Function Documentation

◆ makeGraph()

def lsst.pipe.base.graphBuilder.GraphBuilder.makeGraph (   self,
  pipeline,
  collections,
  run,
  userQuery 
)
Create execution graph for a pipeline.

Parameters
----------
pipeline : `Pipeline`
    Pipeline definition, task names/classes and their configs.
collections
    Expressions representing the collections to search for input
    datasets.  May be any of the types accepted by
    `lsst.daf.butler.CollectionSearch.fromExpression`.
run : `str`, optional
    Name of the `~lsst.daf.butler.CollectionType.RUN` collection for
    output datasets, if it already exists.
userQuery : `str`
    String which defines user-defined selection for registry, should be
    empty or `None` if there is no restrictions on data selection.

Returns
-------
graph : `QuantumGraph`

Raises
------
UserExpressionError
    Raised when user expression cannot be parsed.
OutputExistsError
    Raised when output datasets already exist.
Exception
    Other exceptions types may be raised by underlying registry
    classes.

Definition at line 809 of file graphBuilder.py.

809  def makeGraph(self, pipeline, collections, run, userQuery):
810  """Create execution graph for a pipeline.
811 
812  Parameters
813  ----------
814  pipeline : `Pipeline`
815  Pipeline definition, task names/classes and their configs.
816  collections
817  Expressions representing the collections to search for input
818  datasets. May be any of the types accepted by
819  `lsst.daf.butler.CollectionSearch.fromExpression`.
820  run : `str`, optional
821  Name of the `~lsst.daf.butler.CollectionType.RUN` collection for
822  output datasets, if it already exists.
823  userQuery : `str`
824  String which defines user-defined selection for registry, should be
825  empty or `None` if there is no restrictions on data selection.
826 
827  Returns
828  -------
829  graph : `QuantumGraph`
830 
831  Raises
832  ------
833  UserExpressionError
834  Raised when user expression cannot be parsed.
835  OutputExistsError
836  Raised when output datasets already exist.
837  Exception
838  Other exceptions types may be raised by underlying registry
839  classes.
840  """
841  scaffolding = _PipelineScaffolding(pipeline, registry=self.registry)
842  if not collections and (scaffolding.initInputs or scaffolding.inputs or scaffolding.prerequisites):
843  raise ValueError("Pipeline requires input datasets but no input collections provided.")
844  instrument = pipeline.getInstrument()
845  if isinstance(instrument, str):
846  instrument = doImport(instrument)
847  if instrument is not None:
848  dataId = DataCoordinate.standardize(instrument=instrument.getName(),
849  universe=self.registry.dimensions)
850  else:
851  dataId = DataCoordinate.makeEmpty(self.registry.dimensions)
852  with scaffolding.connectDataIds(self.registry, collections, userQuery, dataId) as commonDataIds:
853  scaffolding.resolveDatasetRefs(self.registry, collections, run, commonDataIds,
854  skipExisting=self.skipExisting)
855  return scaffolding.makeQuantumGraph()

Member Data Documentation

◆ dimensions

lsst.pipe.base.graphBuilder.GraphBuilder.dimensions

Definition at line 806 of file graphBuilder.py.

◆ registry

lsst.pipe.base.graphBuilder.GraphBuilder.registry

Definition at line 805 of file graphBuilder.py.

◆ skipExisting

lsst.pipe.base.graphBuilder.GraphBuilder.skipExisting

Definition at line 807 of file graphBuilder.py.


The documentation for this class was generated from the following file: