DimensionRecordSetDeserializer¶
- class lsst.daf.butler.DimensionRecordSetDeserializer(element: DimensionElement, mapping: dict[tuple[DataIdValue, ...], SerializedKeyValueDimensionRecord])¶
- Bases: - object- A helper class for deserializing sets of dimension records, with support for only fully deserializing certain records. - The - from_rawfactory method should generally be used instead of calling the constructor directly.- Parameters:
- elementDimensionElement
- Dimension element that defines all records. 
- mappingdict[tuple,list]
- A dictionary that maps the data ID required-values - tuplefor reach record to the remainder of its raw serialization (i.e. an item in this- dictis a pair returned by- DimensionRecord.deserialize_key). This- dictwill be used directly to back the deserializer, not copied.
 
- element
 - Notes - The keys (data ID required-values tuples) of all rows are deserialized immediately, but the remaining fields are deserialized only on demand; use - __iter__to deserialize all records or- __getitem__to deserialize only a few. An instance should really only be used for a single iteration or multiple- __getitem__calls, as each call will re-deserialize the records in play; deserialized records are not cached.- The caller is responsible for ensuring that the serialized records are for the given dimension element, as this cannot be checked. Mismatches will probably result in a (confusing) type-validation error, but are not guaranteed to. - Methods Summary - from_raw(element, raw_records)- Construct from raw serialized records. - Methods Documentation - classmethod from_raw(element: DimensionElement, raw_records: Iterable[SerializedKeyValueDimensionRecord]) Self¶
- Construct from raw serialized records. - Parameters:
- elementDimensionElement
- Dimension element that defines all records. 
- raw_recordsIterable[list]
- Serialized records, as returned by - DimensionRecordSet.serialize_recordsor repeated calls to- DimensionRecord.serialize_key_value.
 
- element
- Returns:
- deserializerDimensionRecordSetDeserializer
- New deserializer instance. 
 
- deserializer