makeTestCollection

lsst.daf.butler.tests.makeTestCollection(repo: Butler, uniqueId: str | None = None) Butler

Create a read/write Butler to a fresh collection.

Parameters:
repolsst.daf.butler.Butler

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

uniqueIdstr, optional

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

Returns:
butlerlsst.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.