|
|
| __init__ (self, doc, dtype=None, allowed=None, default=None, optional=True, deprecated=None) |
| |
|
| __class_getitem__ (cls, tuple[type,...]|type|ForwardRef params) |
| |
|
| __init__ (self, doc, dtype=None, default=None, check=None, optional=False, deprecated=None) |
| |
| | rename (self, instance) |
| |
| | validate (self, instance) |
| |
| | freeze (self, instance) |
| |
| | save (self, outfile, instance) |
| |
| | toDict (self, instance) |
| |
|
Field[FieldTypeVar] | __get__ (self, None instance, Any owner=None, Any at=None, str label="default") |
| |
|
FieldTypeVar | __get__ (self, Config instance, Any owner=None, Any at=None, str label="default") |
| |
| | __get__ (self, instance, owner=None, at=None, label="default") |
| |
| None | __set__ (self, Config instance, FieldTypeVar|None value, Any at=None, str label="assignment") |
| |
| | __delete__ (self, instance, at=None, label="deletion") |
| |
|
| | _validateValue (self, value) |
| |
| | _setup (self, doc, dtype, default, check, optional, source, deprecated) |
| |
| | _collectImports (self, instance, imports) |
| |
| Any | _copy_storage (self, Config old, Config new) |
| |
| | _compare (self, instance1, instance2, shortcut, rtol, atol, output) |
| |
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 : `type`
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