DatasetIdFactory¶
- class lsst.daf.butler.DatasetIdFactory¶
Bases:
objectFactory for dataset IDs (UUIDs).
For now the logic is hard-coded and is controlled by the user-provided value of
DatasetIdGenEnum. In the future we may implement a configurable logic that can guessDatasetIdGenEnumvalue from other parameters.Attributes Summary
Namespace UUID used for UUID5 generation.
Methods Summary
makeDatasetId(run, datasetType, dataId, ...)Generate dataset ID for a dataset.
resolveRef(ref, run[, idGenerationMode])Generate resolved dataset reference for predicted datasets.
Attributes Documentation
- NS_UUID = UUID('840b31d9-05cd-5161-b2c8-00d32b280d0f')¶
Namespace UUID used for UUID5 generation. Do not change. This was produced by
uuid.uuid5(uuid.NAMESPACE_DNS, "lsst.org").
Methods Documentation
- makeDatasetId(run: str, datasetType: DatasetType, dataId: DataCoordinate, idGenerationMode: DatasetIdGenEnum) UUID¶
Generate dataset ID for a dataset.
- Parameters:
- run
str Name of the RUN collection for the dataset.
- datasetType
DatasetType Dataset type.
- dataId
DataCoordinate Expanded data ID for the dataset.
- idGenerationMode
DatasetIdGenEnum ID generation option.
UNIQUEmakes a random UUID4-type ID.DATAID_TYPEmakes a deterministic UUID5-type ID based on a dataset type name anddataId.DATAID_TYPE_RUNmakes a deterministic UUID5-type ID based on a dataset type name, run collection name, anddataId.
- run
- Returns:
- datasetId
uuid.UUID Dataset identifier.
- datasetId
- resolveRef(ref: DatasetRef, run: str, idGenerationMode: DatasetIdGenEnum = DatasetIdGenEnum.UNIQUE) DatasetRef¶
Generate resolved dataset reference for predicted datasets.
- Parameters:
- ref
DatasetRef Dataset ref, can be already resolved.
- run
str Name of the RUN collection for the dataset.
- idGenerationMode
DatasetIdGenEnum ID generation option.
UNIQUEmakes a random UUID4-type ID.DATAID_TYPEmakes a deterministic UUID5-type ID based on a dataset type name anddataId.DATAID_TYPE_RUNmakes a deterministic UUID5-type ID based on a dataset type name, run collection name, anddataId.
- ref
- Returns:
- resolved
DatasetRef Resolved dataset ref, if input reference is already resolved it is returned without modification.
- resolved
Deprecated since version 26.0: This method will soon be removed since it will be impossible to create an unresolved ref.