SerializedDatasetRef

class lsst.daf.butler.SerializedDatasetRef(*, id: UUID, datasetType: SerializedDatasetType | None = None, dataId: SerializedDataCoordinate | None = None, run: str | None = None, component: str | None = None)

Bases: BaseModel

Simplified model of a DatasetRef suitable for serialization.

Attributes Summary

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

Methods Summary

check_consistent_parameters(data)

direct(*, id, run[, datasetType, dataId, ...])

Construct a SerializedDatasetRef directly without validators.

Attributes Documentation

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'component': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False), 'dataId': FieldInfo(annotation=Union[SerializedDataCoordinate, NoneType], required=False), 'datasetType': FieldInfo(annotation=Union[SerializedDatasetType, NoneType], required=False), 'id': FieldInfo(annotation=UUID, required=True), 'run': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

Methods Documentation

classmethod check_consistent_parameters(data: dict[str, Any]) dict[str, Any]
classmethod direct(*, id: str, run: str, datasetType: dict[str, Any] | None = None, dataId: dict[str, Any] | None = None, component: str | None = None) SerializedDatasetRef

Construct a SerializedDatasetRef directly without validators.

Parameters:
idstr

The UUID in string form.

runstr

The run for this dataset.

datasetTypedict [str, typing.Any]

A representation of the dataset type.

dataIddict [str, typing.Any]

A representation of the data ID.

componentstr or None

Any component associated with this ref.

Returns:
serializedSerializedDatasetRef

A Pydantic model representing the given parameters.

Notes

This differs from the pydantic “construct” method in that the arguments are explicitly what the model requires, and it will recurse through members, constructing them from their corresponding direct methods.

The id parameter is a string representation of dataset ID, it is converted to UUID by this method.

This method should only be called when the inputs are trusted.