buildExecutionButler¶
-
lsst.pipe.base.
buildExecutionButler
(butler: lsst.daf.butler._butler.Butler, graph: lsst.pipe.base.graph.graph.QuantumGraph, outputLocation: Union[str, lsst.daf.butler.core._butlerUri._butlerUri.ButlerURI], run: str, *, clobber: bool = False, butlerModifier: Optional[Callable[[lsst.daf.butler._butler.Butler], lsst.daf.butler._butler.Butler]] = None, collections: Optional[Iterable[str]] = None) → lsst.daf.butler._butler.Butler¶ buildExecutionButler is a function that is responsible for exporting input
QuantumGraphs
into a new minimalButler
which only contains datasets specified by theQuantumGraph
. These datasets are both those that already exist in the inputButler
, and those that are expected to be produced during the execution of theQuantumGraph
.Parameters: - butler :
lsst.daf.butler.Bulter
This is the existing
Butler
instance from which existing datasets will be exported. This should be theButler
which was used to create anyQuantumGraphs
that will be converted with this object.- graph :
QuantumGraph
Graph containing nodes that are to be exported into an execution butler
- outputLocation :
str
orButlerURI
URI Location at which the execution butler is to be exported. May be specified as a string or a ButlerURI instance.
- run :
str
optional The run collection that the exported datasets are to be placed in. If None, the default value in registry.defaults will be used.
- clobber :
bool
, Optional By default a butler will not be created if a file or directory already exists at the output location. If this is set to
True
what is at the location will be deleted prior to running the export. Defaults toFalse
- butlerModifier :
Callable
, Optional If supplied this should be a callable that accepts a
Butler
, and returns an instantiatedButler
. This callable may be used to make any modifications to theButler
desired. This will be called after importing all datasets that exist in the inputButler
but prior to inserting Datasets expected to be produced. Examples of what this method could do include things such as creating collections/runs/ etc.- collections :
Iterable
ofstr
, Optional An iterable of collection names that will be exported from the input
Butler
when creating the execution butler. If not supplied theButler
’sRegistry
default collections will be used.
Returns: - executionButler :
lsst.daf.butler.Butler
An instance of the newly created execution butler
Raises: - FileExistsError
Raised if something exists in the filesystem at the specified output location and clobber is
False
- NotADirectoryError
Raised if specified output URI does not correspond to a directory
- butler :