lsst.pex.config g364dc83bf4+1d28dfd693
Loading...
Searching...
No Matches
lsst.pex.config.rangeField.RangeField Class Reference
Inheritance diagram for lsst.pex.config.rangeField.RangeField:
lsst.pex.config.config.Field

Public Member Functions

 __init__ (self, doc, dtype, default=None, optional=False, min=None, max=None, inclusiveMin=True, inclusiveMax=False, deprecated=None)
Public Member Functions inherited from lsst.pex.config.config.Field
 __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")

Public Attributes

 min = min
 max = max
bool maxCheck = y
bool minCheck = y
str rangeString
Public Attributes inherited from lsst.pex.config.config.Field
 dtype = dtype
 doc = doc
 deprecated = deprecated
 default = default
 check = check
 optional = optional
 source = source

Protected Member Functions

 _validateValue (self, value)
Protected Member Functions inherited from lsst.pex.config.config.Field
 _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)

Additional Inherited Members

Static Public Attributes inherited from lsst.pex.config.config.Field
dict supportedTypes = {str, bool, float, int, complex}
Static Protected Member Functions inherited from lsst.pex.config.config.Field
Mapping[str, Any] _parseTypingArgs (tuple[type,...]|tuple[str,...] params, Mapping[str, Any] kwds)

Detailed Description

A configuration field (`lsst.pex.config.Field` subclass) that requires
the value to be in a specific numeric range.

Parameters
----------
doc : `str`
    A description of the field.
dtype : {`int`-type, `float`-type}
    The field's data type: either the `int` or `float` type.
default : `int` or `float`, optional
    Default value for the field.
optional : `bool`, optional
    When `False`, `lsst.pex.config.Config.validate` will fail if the
    field's value is `None`.
min : int, float, or `None`, optional
    Minimum value accepted in the range. If `None`, the range has no
    lower bound (equivalent to negative infinity).
max : `int`, `float`, or None, optional
    Maximum value accepted in the range. If `None`, the range has no
    upper bound (equivalent to positive infinity).
inclusiveMin : `bool`, optional
    If `True`, the ``min`` value is included in the allowed range.
inclusiveMax : `bool`, optional
    If `True`, the ``max`` value is included in the allowed range.
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
--------
ChoiceField
ConfigChoiceField
ConfigDictField
ConfigField
ConfigurableField
DictField
Field
ListField
RegistryField

Member Function Documentation

◆ _validateValue()

lsst.pex.config.rangeField.RangeField._validateValue ( self,
value )
protected
Validate a value.

Parameters
----------
value : `object`
    The value being validated.

Raises
------
TypeError
    Raised if the value's type is incompatible with the field's
    ``dtype``.
ValueError
    Raised if the value is rejected by the ``check`` method.

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

Member Data Documentation

◆ rangeString

str lsst.pex.config.rangeField.RangeField.rangeString
Initial value:
= "{}{},{}{}".format(
("[" if inclusiveMin else "("),
("-inf" if self.min is None else self.min),
("inf" if self.max is None else self.max),
("]" if inclusiveMax else ")"),
)

The documentation for this class was generated from the following file:
  • python/lsst/pex/config/rangeField.py