DatabaseDict¶
-
class
lsst.daf.butler.DatabaseDict(config, types, key, value)¶ Bases:
collections.abc.MutableMappingAn abstract base class for dict-like objects with a specific key type and namedtuple values, backed by a database.
DatabaseDict subclasses must implement the abstract
__getitem__,__setitem__,__delitem__`, ``__iter__, and__len__abstract methods defined byMutableMapping.They must also provide a constructor that takes the same arguments as that of
DatabaseDictitself, unless they are constructed solely byRegistry.makeDatabaseDict(in which case any constructor arguments are permitted).Parameters: - config :
Config Configuration used to identify and construct a subclass.
- types :
dict A dictionary mapping
strfield names to type objects, containing all fields to be held in the database.- key :
str The name of the field to be used as the dictionary key. Must not be present in
value._fields.- value :
type The type used for the dictionary’s values, typically a
namedtuple. Must have a_fieldsclass attribute that is a tuple of field names (i.e. as defined bynamedtuple); these field names must also appear in thetypesarg, and a_makeattribute to construct it from a sequence of values (again, as defined bynamedtuple).
- config :