makeTestRepo¶
-
lsst.daf.butler.tests.
makeTestRepo
(root: str, dataIds: Optional[Mapping[str, Iterable[T_co]]] = None, *, config: lsst.daf.butler.core.config.Config = None, **kwargs) → lsst.daf.butler._butler.Butler¶ Create an empty test repository.
Parameters: - root :
str
The location of the root directory for the repository.
- dataIds :
Mapping
[str
,iterable
], optional A mapping keyed by the dimensions used in the test. Each value is an iterable of names for that dimension (e.g., detector IDs for
"detector"
). Related dimensions (e.g., instruments and detectors) are linked arbitrarily. This parameter is provided for compatibility with old code; newer code should make the repository, then calladdDataIdValue
.- config :
lsst.daf.butler.Config
, optional A configuration for the repository (for details, see
lsst.daf.butler.Butler.makeRepo
). If omitted, creates a repository with default dataset and storage types, but optimized for speed. The defaults set.datastore.cls
,.datastore.checksum
and.registry.db
. If a supplied config does not specify these values the internal defaults will be used to ensure that we have a usable configuration.- **kwargs
Extra arguments to
lsst.daf.butler.Butler.makeRepo
.
Returns: - butler :
lsst.daf.butler.Butler
A Butler referring to the new repository. This Butler is provided only for additional setup; to keep test cases isolated, it is highly recommended that each test create its own Butler with a unique run/collection. See
makeTestCollection
.
Notes
This function provides a “quick and dirty” repository for simple unit tests that don’t depend on complex data relationships. It is ill-suited for tests where the structure of the data matters. If you need such a dataset, create it directly or use a saved test dataset.
- root :