lsst.pex.config  16.0-3-g9645794+8
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pex.config.listField.ListField Class Reference
Inheritance diagram for lsst.pex.config.listField.ListField:
lsst.pex.config.config.Field

Public Member Functions

def __init__ (self, doc, dtype, default=None, optional=False, listCheck=None, itemCheck=None, length=None, minLength=None, maxLength=None)
 
def validate (self, instance)
 
def __set__ (self, instance, value, at=None, label="assignment")
 
def toDict (self, instance)
 
def rename (self, instance)
 
def freeze (self, instance)
 
def save (self, outfile, instance)
 
def __get__ (self, instance, owner=None, at=None, label="default")
 
def __delete__ (self, instance, at=None, label='deletion')
 

Public Attributes

 listCheck
 
 itemCheck
 
 itemtype
 
 length
 
 minLength
 
 maxLength
 
 dtype
 
 doc
 
 default
 
 check
 
 optional
 
 source
 

Static Public Attributes

 supportedTypes = set((str, bool, float, int, complex))
 

Detailed Description

Defines a field which is a container of values of type dtype

If length is not None, then instances of this field must match this length
exactly.
If minLength is not None, then instances of the field must be no shorter
then minLength
If maxLength is not None, then instances of the field must be no longer
than maxLength

Additionally users can provide two check functions:
listCheck - used to validate the list as a whole, and
itemCheck - used to validate each item individually

Definition at line 151 of file listField.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pex.config.listField.ListField.__init__ (   self,
  doc,
  dtype,
  default = None,
  optional = False,
  listCheck = None,
  itemCheck = None,
  length = None,
  minLength = None,
  maxLength = None 
)

Definition at line 168 of file listField.py.

Member Function Documentation

◆ __delete__()

def lsst.pex.config.config.Field.__delete__ (   self,
  instance,
  at = None,
  label = 'deletion' 
)
inherited
Describe how attribute deletion should occur on the Config instance.
This is invoked by the owning config object and should not be called
directly

Definition at line 329 of file config.py.

◆ __get__()

def lsst.pex.config.config.Field.__get__ (   self,
  instance,
  owner = None,
  at = None,
  label = "default" 
)
inherited
Define how attribute access should occur on the Config instance
This is invoked by the owning config object and should not be called
directly

When the field attribute is accessed on a Config class object, it
returns the field object itself in order to allow inspection of
Config classes.

When the field attribute is access on a config instance, the actual
value described by the field (and held by the Config instance) is
returned.

Definition at line 272 of file config.py.

◆ __set__()

def lsst.pex.config.listField.ListField.__set__ (   self,
  instance,
  value,
  at = None,
  label = "assignment" 
)

Definition at line 222 of file listField.py.

◆ freeze()

def lsst.pex.config.config.Field.freeze (   self,
  instance 
)
inherited
Make this field read-only.
Only important for fields which hold sub-configs.
Fields which hold subconfigs should freeze each sub-config.

Definition at line 211 of file config.py.

◆ rename()

def lsst.pex.config.config.Field.rename (   self,
  instance 
)
inherited
Rename an instance of this field, not the field itself.
This is invoked by the owning config object and should not be called
directly

Only useful for fields which hold sub-configs.
Fields which hold subconfigs should rename each sub-config with
the full field name as generated by _joinNamePath

Definition at line 186 of file config.py.

◆ save()

def lsst.pex.config.config.Field.save (   self,
  outfile,
  instance 
)
inherited
Saves an instance of this field to file.
This is invoked by the owning config object, and should not be called
directly

outfile ---- an open output stream.

Definition at line 238 of file config.py.

◆ toDict()

def lsst.pex.config.listField.ListField.toDict (   self,
  instance 
)

Definition at line 237 of file listField.py.

◆ validate()

def lsst.pex.config.listField.ListField.validate (   self,
  instance 
)
ListField validation ensures that non-optional fields are not None,
    and that non-None values comply with length requirements and
    that the list passes listCheck if supplied by the user.
Individual Item checks are applied at set time and are not re-checked.

Definition at line 198 of file listField.py.

Member Data Documentation

◆ check

lsst.pex.config.config.Field.check
inherited

Definition at line 182 of file config.py.

◆ default

lsst.pex.config.config.Field.default
inherited

Definition at line 181 of file config.py.

◆ doc

lsst.pex.config.config.Field.doc
inherited

Definition at line 179 of file config.py.

◆ dtype

lsst.pex.config.config.Field.dtype
inherited

Definition at line 178 of file config.py.

◆ itemCheck

lsst.pex.config.listField.ListField.itemCheck

Definition at line 192 of file listField.py.

◆ itemtype

lsst.pex.config.listField.ListField.itemtype

Definition at line 193 of file listField.py.

◆ length

lsst.pex.config.listField.ListField.length

Definition at line 194 of file listField.py.

◆ listCheck

lsst.pex.config.listField.ListField.listCheck

Definition at line 191 of file listField.py.

◆ maxLength

lsst.pex.config.listField.ListField.maxLength

Definition at line 196 of file listField.py.

◆ minLength

lsst.pex.config.listField.ListField.minLength

Definition at line 195 of file listField.py.

◆ optional

lsst.pex.config.config.Field.optional
inherited

Definition at line 183 of file config.py.

◆ source

lsst.pex.config.config.Field.source
inherited

Definition at line 184 of file config.py.

◆ supportedTypes

lsst.pex.config.config.Field.supportedTypes = set((str, bool, float, int, complex))
staticinherited

Definition at line 153 of file config.py.


The documentation for this class was generated from the following file: