DatabaseDictRecordBase¶
-
class
lsst.daf.butler.
DatabaseDictRecordBase
¶ Bases:
collections.abc.Sequence
,typing.Generic
A base class to be used to define a record to be stored in a
DatabaseDict
.Expected to be subclassed with a dataclass defining the fields and types to be stored in the registry, along with a specification of lengths of string fields.
The fields themselves can be retrieved by index and the number of fields defined in the class can be queried.
Attributes Summary
lengths
Lengths of string fields (optional). Methods Summary
count
(value)fields
()Emulate the namedtuple._fields class attribute index
(value, [start, [stop]])Raises ValueError if the value is not present. types
()Return a dict indexed by name and with the python type as the value. Attributes Documentation
-
lengths
= {}¶ Lengths of string fields (optional).
Methods Documentation
-
count
(value) → integer -- return number of occurrences of value¶
-
classmethod
fields
() → Sequence[str]¶ Emulate the namedtuple._fields class attribute
-
index
(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
-
classmethod
types
() → Dict[str, Type[CT_co]]¶ Return a dict indexed by name and with the python type as the value.
-