lsst.pex.config
13.0-3-g520d906+6
|
Public Member Functions | |
def | __init__ (self, doc, keytype, itemtype, default=None, optional=False, dictCheck=None, itemCheck=None) |
def | validate (self, instance) |
def | __set__ (self, instance, value, at=None, label="assignment") |
def | toDict (self, instance) |
![]() | |
def | __init__ (self, doc, dtype, default=None, check=None, optional=False) |
def | rename (self, instance) |
def | validate (self, instance) |
def | freeze (self, instance) |
def | save (self, outfile, instance) |
def | toDict (self, instance) |
def | __get__ (self, instance, owner=None, at=None, label="default") |
def | __set__ (self, instance, value, at=None, label='assignment') |
def | __delete__ (self, instance, at=None, label='deletion') |
Public Attributes | |
keytype | |
itemtype | |
dictCheck | |
itemCheck | |
![]() | |
dtype | |
doc | |
default | |
check | |
optional | |
source | |
Static Public Attributes | |
DictClass = Dict | |
![]() | |
supportedTypes = set((str, unicode, basestring, oldStringType, bool, float, int, complex)) | |
Defines a field which is a mapping of values Both key and item types are restricted to builtin POD types: (int, float, complex, bool, str) Users can provide two check functions: dictCheck: used to validate the dict as a whole, and itemCheck: used to validate each item individually For example to define a field which is a mapping from names to int values: class MyConfig(Config): field = DictField( doc="example string-to-int mapping field", keytype=str, itemtype=int, default= {})
Definition at line 141 of file dictField.py.
def lsst.pex.config.dictField.DictField.__init__ | ( | self, | |
doc, | |||
keytype, | |||
itemtype, | |||
default = None , |
|||
optional = False , |
|||
dictCheck = None , |
|||
itemCheck = None |
|||
) |
Definition at line 162 of file dictField.py.
def lsst.pex.config.dictField.DictField.__set__ | ( | self, | |
instance, | |||
value, | |||
at = None , |
|||
label = "assignment" |
|||
) |
Definition at line 195 of file dictField.py.
def lsst.pex.config.dictField.DictField.toDict | ( | self, | |
instance | |||
) |
Definition at line 211 of file dictField.py.
def lsst.pex.config.dictField.DictField.validate | ( | self, | |
instance | |||
) |
DictField validation ensures that non-optional fields are not None, and that non-None values comply with dictCheck. Individual Item checks are applied at set time and are not re-checked.
Definition at line 182 of file dictField.py.
lsst.pex.config.dictField.DictField.dictCheck |
Definition at line 179 of file dictField.py.
|
static |
Definition at line 160 of file dictField.py.
lsst.pex.config.dictField.DictField.itemCheck |
Definition at line 180 of file dictField.py.
lsst.pex.config.dictField.DictField.itemtype |
Definition at line 178 of file dictField.py.
lsst.pex.config.dictField.DictField.keytype |
Definition at line 177 of file dictField.py.