Float type argument.
More...
|
def | __init__ (self, value=None, min=None, max=None, runarg=True, name=None) |
| Float argument constructor. More...
|
|
def | value (self) |
| Argument value getter. More...
|
|
def | prodsysDescription (self) |
|
def | value (self, value=None) |
| Setter function. More...
|
|
def | isRunarg (self) |
| Return runarg status. More...
|
|
def | name (self) |
| Name getter. More...
|
|
def | name (self, value) |
| Name setter. More...
|
|
def | __str__ (self) |
| String conversion of our value. More...
|
|
def | __repr__ (self) |
| Repr conversion of our value. More...
|
|
def | __eq__ (self, other) |
| Comparison is based on value attribute. More...
|
|
def | __nq__ (self, other) |
|
def | __lt__ (self, other) |
|
def | __gt__ (self, other) |
|
Float type argument.
Definition at line 261 of file trfArgClasses.py.
◆ __init__()
def python.trfArgClasses.argFloat.__init__ |
( |
|
self, |
|
|
|
value = None , |
|
|
|
min = None , |
|
|
|
max = None , |
|
|
|
runarg = True , |
|
|
|
name = None |
|
) |
| |
Float argument constructor.
- Parameters
-
value | Initial value to set, default None, |
min | Minimum value for any limits that need to be set |
max | Maximum value for any limits that need to be set |
Definition at line 267 of file trfArgClasses.py.
267 def __init__(self, value=None, min=None, max=None, runarg=True, name=None):
270 super(argFloat, self).
__init__(value = value, runarg = runarg, name=name)
◆ __eq__()
def python.trfArgClasses.argument.__eq__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
|
inherited |
Comparison is based on value attribute.
Definition at line 161 of file trfArgClasses.py.
161 def __eq__(self,other):
162 return self.value == other.value
◆ __gt__()
def python.trfArgClasses.argument.__gt__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
|
inherited |
Definition at line 170 of file trfArgClasses.py.
170 def __gt__(self, other):
171 return self.value > other.value
◆ __lt__()
def python.trfArgClasses.argument.__lt__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
|
inherited |
Definition at line 167 of file trfArgClasses.py.
167 def __lt__(self, other):
168 return self.value < other.value
◆ __nq__()
def python.trfArgClasses.argument.__nq__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
|
inherited |
Definition at line 164 of file trfArgClasses.py.
164 def __nq__(self, other):
165 return self.value != other.value
◆ __repr__()
def python.trfArgClasses.argument.__repr__ |
( |
|
self | ) |
|
|
inherited |
◆ __str__()
def python.trfArgClasses.argument.__str__ |
( |
|
self | ) |
|
|
inherited |
◆ isRunarg()
def python.trfArgClasses.argument.isRunarg |
( |
|
self | ) |
|
|
inherited |
◆ name() [1/2]
def python.trfArgClasses.argument.name |
( |
|
self | ) |
|
|
inherited |
◆ name() [2/2]
def python.trfArgClasses.argument.name |
( |
|
self, |
|
|
|
value |
|
) |
| |
|
inherited |
◆ prodsysDescription()
def python.trfArgClasses.argFloat.prodsysDescription |
( |
|
self | ) |
|
◆ value() [1/2]
def python.trfArgClasses.argFloat.value |
( |
|
self | ) |
|
◆ value() [2/2]
def python.trfArgClasses.argFloat.value |
( |
|
self, |
|
|
|
value = None |
|
) |
| |
Setter function.
The argument can be anything, if it is not of type float
, it will attempt to convert using float()
.
- Parameters
-
- Exceptions
-
Reimplemented from python.trfArgClasses.argument.
Definition at line 293 of file trfArgClasses.py.
293 def value(self, value=None):
296 if self._min
is not None:
297 self._value = self._min
302 if isinstance(value, float):
305 self._value =
float(value)
307 raise trfExceptions.TransformArgException(trfExit.nameToCode(
'TRF_ARG_CONV_FAIL'),
308 'Failed to convert %s to a float' %
str(value))
310 if (self._min
is not None and self.value < self._min)
or (self._max
is not None and self._value > self._max):
311 raise trfExceptions.TransformArgException(trfExit.nameToCode(
'TRF_ARG_OUT_OF_RANGE'),
312 'argFloat value out of range: %g is not between %s and %s' %
313 (self.value, self._min, self._max))
◆ _max
python.trfArgClasses.argFloat._max |
|
private |
◆ _min
python.trfArgClasses.argFloat._min |
|
private |
◆ _name
python.trfArgClasses.argument._name |
|
privateinherited |
◆ _runarg
python.trfArgClasses.argument._runarg |
|
privateinherited |
◆ _value
python.trfArgClasses.argFloat._value |
|
private |
◆ value
python.trfArgClasses.argument.value |
|
inherited |
- Note
- We have a default of None here, but all derived classes should definitely have their own value setter and translate this value to something sensible for their underlying value type. N.B. As most argument classes use this default constructor it must call the
@value
.setter function!
Definition at line 118 of file trfArgClasses.py.
The documentation for this class was generated from the following file: