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)], tuple[int, int]]])¶
Bases:
BaseModelSimplified model for serializing a
DimensionRecord.Attributes Summary
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].Metadata about the fields defined on the model, mapping of field names to [
FieldInfo][pydantic.fields.FieldInfo].Methods Summary
direct(*, definition, record)Construct a
SerializedDimensionRecorddirectly 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].
- 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)], tuple[int, int]]], 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, Union[NoneType, bool, int, float, str, tuple[int, int]]]) SerializedDimensionRecord¶
Construct a
SerializedDimensionRecorddirectly without validators.- Parameters:
- Returns:
- rec
SerializedDimensionRecord A model representing the dimension records.
- rec
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
directmethods.This method should only be called when the inputs are trusted.