DimensionRecordsAccumulator

class lsst.daf.butler.DimensionRecordsAccumulator

Bases: object

Class used to accumulate dimension records for serialization.

This class generates an auto increment key for each unique dimension record added to it. This allows serialization of dimension records to occur once for each record but be refereed to multiple times.

Methods Summary

addRecord(record) Add a dimension record to the accumulator if it has not already been added.
makeSerializedDimensionRecordMapping()

Methods Documentation

addRecord(record: lsst.daf.butler.core.dimensions._records.DimensionRecord) → int

Add a dimension record to the accumulator if it has not already been added. When a record is inserted for the first time it is assigned a unique integer key.

This function returns the key associated with the record (either the newly allocated key, or the existing one)

Parameters:
record : DimensionRecord

The record to add to the accumulator

Returns:
accumulatorKey : int

The key that is associated with the supplied record

makeSerializedDimensionRecordMapping() → Mapping[int, lsst.daf.butler.core.dimensions._records.SerializedDimensionRecord]