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_config

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

Methods Summary

direct(*, definition, record)

Construct a SerializedDimensionRecord directly without validators.

Attributes Documentation

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].

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.