DatabaseDict¶
-
class
lsst.daf.butler.
DatabaseDict
(config, types, key, value)¶ Bases:
collections.abc.MutableMapping
An 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
DatabaseDict
itself, 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
str
field 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_fields
class attribute that is a tuple of field names (i.e. as defined bynamedtuple
); these field names must also appear in thetypes
arg, and a_make
attribute to construct it from a sequence of values (again, as defined bynamedtuple
).
- config :