makeTestCollection

lsst.daf.butler.tests.makeTestCollection(repo: lsst.daf.butler._butler.Butler, uniqueId: Optional[str] = None) → lsst.daf.butler._butler.Butler

Create a read/write Butler to a fresh collection.

Parameters:
repo : lsst.daf.butler.Butler

A previously existing Butler to a repository, such as that returned by makeRepo or makeTestRepo.

uniqueId : str, optional

A collection ID guaranteed by external code to be unique across all calls to makeTestCollection for the same repository.

Returns:
butler : lsst.daf.butler.Butler

A Butler referring to a new collection in the repository at root. The collection is (almost) guaranteed to be new.

Notes

This function creates a single run collection that does not necessarily conform to any repository conventions. It is only suitable for creating an isolated test area, and not for repositories intended for real data processing or analysis.