SerializedDimensionRecord

class lsst.daf.butler.SerializedDimensionRecord(*, definition: str, record: dict[str, typing.Union[NoneType, typing.Annotated[bool, Strict(strict=True)], typing.Annotated[int, Strict(strict=True)], typing.Annotated[float, Strict(strict=True)], typing.Annotated[str, Strict(strict=True)], lsst.daf.butler._timespan.Timespan]])

Bases: BaseModel

Simplified model for serializing a DimensionRecord.

Attributes Summary

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

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(*, definition, record)

Construct a SerializedDimensionRecord directly without validators.

Attributes Documentation

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'examples': [{'definition': 'detector', 'record': {'instrument': 'HSC', 'id': 72, 'full_name': '0_01', 'name_in_raft': '01', 'raft': '0', 'purpose': 'SCIENCE'}}]}}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'definition': FieldInfo(annotation=str, required=True, title='Name of dimension associated with this record.', examples=['exposure']), 'record': FieldInfo(annotation=dict[str, Union[NoneType, Annotated[bool, Strict(strict=True)], Annotated[int, Strict(strict=True)], Annotated[float, Strict(strict=True)], Annotated[str, Strict(strict=True)], Timespan]], required=True, title='Dimension record keys and values.', examples=[{'definition': 'exposure', 'record': {'instrument': 'LATISS', 'exposure': 2021050300044, 'obs_id': 'AT_O_20210503_00044'}}])}

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(*, definition: str, record: dict[str, Any]) SerializedDimensionRecord

Construct a SerializedDimensionRecord directly without validators.

Parameters:
definitionstr

The name of the record.

recorddict

A dictionary representation of the record content.

Returns:
recSerializedDimensionRecord

A model representing the dimension records.

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.