expandUniqueId

lsst.daf.butler.tests.expandUniqueId(butler: Butler, partialId: Mapping[str, Any]) DataCoordinate

Return a complete data ID matching some criterion.

Parameters:
butlerlsst.daf.butler.Butler

The repository to query.

partialIdMapping [str]

A mapping of known dimensions and values.

Returns:
dataIdlsst.daf.butler.DataCoordinate

The unique data ID that matches partialId.

Raises:
ValueError

Raised if partialId does not uniquely identify a data ID.

Notes

This method will only work correctly if all dimensions attached to the target dimension (eg., “physical_filter” for “visit”) are known to the repository, even if they’re not needed to identify a dataset. This function is only suitable for certain kinds of test repositories, and not for repositories intended for real data processing or analysis.

Examples

>>> butler = makeTestRepo(
        "testdir", {"instrument": ["notACam"], "detector": [1]})
>>> expandUniqueId(butler, {"detector": 1})
DataCoordinate({instrument, detector}, ('notACam', 1))