InMemoryRepo#
- class lsst.pipe.base.tests.mocks.InMemoryRepo(*args: str | ResourcePath, registry_config: RegistryConfig | None = None, dimension_config: DimensionConfig | None = None, 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:
MockRepoA test helper that simulates a butler repository for task execution without any disk I/O.
Parameters#
- *args
strorlsst.resources.ResourcePath Butler YAML import files to load into the test repository.
- registry_config
lsst.daf.butler.RegistryConfig, optional Registry configuration for the repository.
- dimension_config
lsst.daf.butler.DimensionConfig, optional Dimension universe configuration for the repository.
- input_run
str, optional Name of a
RUNcollection that will be used as an input to quantum graph generation. Input datasets created by the helper are added to this collection.- input_chain
str, optional Name of a
CHAINEDcollection that will be the direct input to quantum graph generation. This always includesinput_run.- use_import_collections_as_input
bool,str, orIterable[str], optional Additional collections from YAML import files to include in
input_chain, orTrueto 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 thelsst.daf.butler.tests.registry_datapackage.
Notes#
This helper maintains an
pipeline_graph.PipelineGraphand 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 a test limited butler for execution.
Make a single-quantum executor backed by a new limited butler.
Methods Documentation
- make_limited_butler() InMemoryLimitedButler#
Make a test limited butler for execution.
Returns#
- limited_butler
InMemoryLimitedButler A limited butler that can be used for task execution.
Notes#
This queries the database-only butler used for quantum-graph generation for all datasets in the
input_chaincollection, and populates the limited butler with those that have a mock storage class. Other datasets are ignored, so they will appear as though they were present during quantum graph generation but absent during execution.- limited_butler
- make_single_quantum_executor(qg: PredictedQuantumGraph | None = None) tuple[SingleQuantumExecutor, InMemoryLimitedButler]#
Make a single-quantum executor backed by a new limited butler.
Parameters#
- qg
quantum_graph.PredictedQuantumGraph Ignored by this implementation.
Returns#
- executor
single_quantum_executor.SingleQuantumExecutor An executor for a single quantum.
- butler
InMemoryLimitedButler The butler that the executor will write to.
- qg
- *args