DimensionRecord¶
-
class
lsst.daf.butler.DimensionRecord(*args)¶ Bases:
objectBase class for the Python representation of database records for a
DimensionElement.Parameters: - args
Field values for this record, ordered to match
__slots__.
Notes
DimensionRecordsubclasses are created dynamically for eachDimensionElementin aDimensionUniverse, and are accessible via theDimensionElement.RecordClassattribute. TheDimensionRecordbase class itself is pure abstract, but does not use theabcmodule to indicate this because it does not have overridable methods.Record classes have attributes that correspond exactly to the fields in the related database table, a few additional methods inherited from the
DimensionRecordbase class, and two additional injected attributes:definitionis a class attribute that holds theDimensionElement;timespanis a property that returns aTimespan, present only on record classes that correspond to temporal elements.
The field attributes are defined via the
__slots__mechanism, and the__slots__tuple itself is considered the public interface for obtaining the list of fields.Instances are usually obtained from a
Registry, but in the rare cases where they are constructed directly in Python (usually for insertion into aRegistry), thefromDictmethod should generally be used.DimensionRecordinstances are immutable.Attributes Summary
dataIdA dict-like identifier for this record’s primary keys ( DataCoordinate).Methods Summary
fromDict(mapping, Any])Construct a DimensionRecordsubclass instance from a mapping of field values.toDict()Return a vanilla dictrepresentation of this record.Attributes Documentation
-
dataId¶ A dict-like identifier for this record’s primary keys (
DataCoordinate).
Methods Documentation
-
classmethod
fromDict(mapping: Mapping[str, Any])¶ Construct a
DimensionRecordsubclass instance from a mapping of field values.Parameters: - mapping :
Mapping Field values, keyed by name. The keys must match those in
__slots__, with the exception that a dimension name may be used in place of the primary key name - for example, “tract” may be used instead of “id” for the “id” primary key field of the “tract” dimension.
Returns: - record :
DimensionRecord An instance of this subclass of
DimensionRecord.
- mapping :