lsst.pex.config 22.0.1-4-g5bf565c+8df2340bc4
Public Member Functions | Public Attributes | List of all members
lsst.pex.config.choiceField.ChoiceField Class Reference
Inheritance diagram for lsst.pex.config.choiceField.ChoiceField:
lsst.pex.config.config.Field

Public Member Functions

def __init__ (self, doc, dtype, allowed, default=None, optional=True, deprecated=None)
 
- Public Member Functions inherited from lsst.pex.config.config.Field
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

 allowed
 
 source
 
- Public Attributes inherited from lsst.pex.config.config.Field
 dtype
 
 doc
 
 deprecated
 
 default
 
 check
 
 optional
 
 source
 

Additional Inherited Members

- Static Public Attributes inherited from lsst.pex.config.config.Field
 supportedTypes = set((str, bool, float, int, complex))
 

Detailed Description

A configuration field (`~lsst.pex.config.Field` subclass) that allows a
user to select from a predefined set of values.

Use ``ChoiceField`` when a configuration can only take one of a predefined
set of values. Each choice must be of the same type.

Parameters
----------
doc : `str`
    Documentation string that describes the configuration field.
dtype : class
    The type of the field's choices. For example, `str` or `int`.
allowed : `dict`
    The allowed values. Keys are the allowed choices (of ``dtype``-type).
    Values are descriptions (`str`-type) of each choice.
default : ``dtype``-type, optional
    The default value, which is of type ``dtype`` and one of the allowed
    choices.
optional : `bool`, optional
    If `True`, this configuration field is *optional*. Default is `True`.
deprecated : None or `str`, optional
    A description of why this Field is deprecated, including removal date.
    If not None, the string is appended to the docstring for this Field.

See also
--------
ConfigChoiceField
ConfigDictField
ConfigField
ConfigurableField
DictField
Field
ListField
RangeField
RegistryField

Constructor & Destructor Documentation

◆ __init__()

def lsst.pex.config.choiceField.ChoiceField.__init__ (   self,
  doc,
  dtype,
  allowed,
  default = None,
  optional = True,
  deprecated = None 
)

Reimplemented from lsst.pex.config.config.Field.


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