SerializedQuantum

class lsst.daf.butler.SerializedQuantum(*, taskName: str | None = None, dataId: SerializedDataCoordinate | None = None, datasetTypeMapping: Mapping[str, SerializedDatasetType], initInputs: Mapping[str, tuple[lsst.daf.butler._dataset_ref.SerializedDatasetRef, list[int]]], inputs: Mapping[str, list[tuple[lsst.daf.butler._dataset_ref.SerializedDatasetRef, list[int]]]], outputs: Mapping[str, list[tuple[lsst.daf.butler._dataset_ref.SerializedDatasetRef, list[int]]]], dimensionRecords: dict[int, lsst.daf.butler.dimensions._records.SerializedDimensionRecord] | None = None, datastoreRecords: dict[str, lsst.daf.butler.datastore.record_data.SerializedDatastoreRecordData] | None = None)

Bases: BaseModel

Simplified model of a Quantum 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

direct(*, taskName, dataId, ...)

Construct a SerializedQuantum 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]] = {'dataId': FieldInfo(annotation=Union[SerializedDataCoordinate, NoneType], required=False), 'datasetTypeMapping': FieldInfo(annotation=Mapping[str, SerializedDatasetType], required=True), 'datastoreRecords': FieldInfo(annotation=Union[dict[str, SerializedDatastoreRecordData], NoneType], required=False), 'dimensionRecords': FieldInfo(annotation=Union[dict[int, SerializedDimensionRecord], NoneType], required=False), 'initInputs': FieldInfo(annotation=Mapping[str, tuple[SerializedDatasetRef, list[int]]], required=True), 'inputs': FieldInfo(annotation=Mapping[str, list[tuple[SerializedDatasetRef, list[int]]]], required=True), 'outputs': FieldInfo(annotation=Mapping[str, list[tuple[SerializedDatasetRef, list[int]]]], required=True), 'taskName': FieldInfo(annotation=Union[str, 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 direct(*, taskName: str | None, dataId: dict | None, datasetTypeMapping: Mapping[str, dict], initInputs: Mapping[str, tuple[dict, list[int]]], inputs: Mapping[str, list[tuple[dict, list[int]]]], outputs: Mapping[str, list[tuple[dict, list[int]]]], dimensionRecords: dict[int, dict] | None, datastoreRecords: dict[str, dict] | None) SerializedQuantum

Construct a SerializedQuantum directly without validators.

Parameters:
taskNamestr or None

The name of the task.

dataIddict or None

The dataId of the quantum.

datasetTypeMappingMapping [str, dict]

Dataset type definitions.

initInputsMapping

The quantum init inputs.

inputsMapping

The quantum inputs.

outputsMapping

The quantum outputs.

dimensionRecordsdict [int, dict] or None

The dimension records.

datastoreRecordsdict [str, dict] or None

The datastore records.

Returns:
quantumSerializedQuantum

Serializable model of the quantum.

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.

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