buildExecutionButler¶
- lsst.pipe.base.buildExecutionButler(butler: DirectButler, graph: QuantumGraph, outputLocation: str | ParseResult | ResourcePath | Path, run: str | None, *, clobber: bool = False, butlerModifier: Callable[[Butler], Butler] | None = None, collections: Iterable[str] | None = None, datastoreRoot: str | ParseResult | ResourcePath | Path | None = None, transfer: str = 'auto') Butler¶
- Create an execution butler. - Responsible for exporting input - QuantumGraphs into a new minimal- Butlerwhich only contains datasets specified by the- QuantumGraph.- These datasets are both those that already exist in the input - Butler, and those that are expected to be produced during the execution of the- QuantumGraph.- Parameters:
- butlerlsst.daf.butler.Butler
- This is the existing - Butlerinstance from which existing datasets will be exported. This should be the- Butlerwhich was used to create any- QuantumGraphsthat will be converted with this object.
- graphQuantumGraph
- Graph containing nodes that are to be exported into an execution butler. 
- outputLocationconvertible to ResourcePath
- URI Location at which the execution butler is to be exported. May be specified as a string or a - ResourcePathinstance.
- runstr, optional
- The run collection that the exported datasets are to be placed in. If None, the default value in registry.defaults will be used. 
- clobberbool, 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 - Truewhat is at the location will be deleted prior to running the export. Defaults to- False.
- butlerModifierCallable, Optional
- If supplied this should be a callable that accepts a - Butler, and returns an instantiated- Butler. This callable may be used to make any modifications to the- Butlerdesired. This will be called after importing all datasets that exist in the input- Butlerbut prior to inserting Datasets expected to be produced. Examples of what this method could do include things such as creating collections/runs/ etc.
- collectionsIterableofstr, Optional
- An iterable of collection names that will be exported from the input - Butlerwhen creating the execution butler. If not supplied the- Butler‘s- Registrydefault collections will be used.
- datastoreRootconvertible to ResourcePath, Optional
- Root directory for datastore of execution butler. If - None, then the original butler’s datastore will be used.
- transferstr
- How (and whether) the input datasets should be added to the execution butler datastore. This should be a - transferstring recognized by- lsst.resources.ResourcePath.transfer_from().- "auto"means to- "copy"if the- datastoreRootis specified.
 
- butler
- Returns:
- executionButlerlsst.daf.butler.Butler
- An instance of the newly created execution butler. 
 
- executionButler
- 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.