DirectButlerRepo#

class lsst.pipe.base.tests.mocks.DirectButlerRepo(butler: Butler, *args: str | ResourcePath, input_run: str = 'input_run', input_chain: str = 'input_chain', use_import_collections_as_input: bool | str | Iterable[str] = True, data_root: str | ParseResult | ResourcePath | Path | None = 'resource://lsst.daf.butler/tests/registry_data')#

Bases: MockRepo

A test helper for task execution backed by a local direct butler.

Parameters#

butlerlsst.daf.butler.direct_butler.DirectButler

Butler to write to.

*argsstr or lsst.resources.ResourcePath

Butler YAML import files to load into the test repository.

input_runstr, optional

Name of a RUN collection that will be used as an input to quantum graph generation. Input datasets created by the helper are added to this collection.

input_chainstr, optional

Name of a CHAINED collection that will be the direct input to quantum graph generation. This always includes input_run.

use_import_collections_as_inputbool, str, or Iterable [ str], optional

Additional collections from YAML import files to include in input_chain, or True to include all such collections (in chain-flattened lexicographical order).

data_rootconvertible to lsst.resources.ResourcePath, optional

Root directory to join to each element in *args. Defaults to the lsst.daf.butler.tests.registry_data package.

Notes#

This helper maintains an pipeline_graph.PipelineGraph and a no-datastore butler backed by an in-memory SQLite database for use in quantum graph generation. It creates a separate in-memory limited butler for execution as needed.

Methods Summary

make_single_quantum_executor([qg])

Make a single-quantum executor backed by a new limited butler.

make_temporary(*args[, input_run, ...])

Methods Documentation

make_single_quantum_executor(qg: PredictedQuantumGraph | None = None) tuple[SingleQuantumExecutor, Butler]#

Make a single-quantum executor backed by a new limited butler.

Parameters#

qgquantum_graph.PredictedQuantumGraph

Ignored by this implementation.

Returns#

executorsingle_quantum_executor.SingleQuantumExecutor

An executor for a single quantum.

butlerlsst.daf.butler.Butler

The butler that the executor will write to.

classmethod make_temporary(*args: str | ResourcePath, input_run: str = 'input_run', input_chain: str = 'input_chain', use_import_collections_as_input: bool | str | Iterable[str] = True, data_root: str | ParseResult | ResourcePath | Path | None = 'resource://lsst.daf.butler/tests/registry_data', **kwargs: Any) Iterator[tuple[DirectButlerRepo, str]]#