| Trees | Indices | Help |
|
|---|
|
|
Number is a numeric parameter. Numbers have a default value and optional bounds. There are two types of bounds: bounds and softbounds. bounds are hard bounds: the parameter must have a value within the specified range. The default bounds are (None,None), meaning there are actually no hard bounds. One or both bounds can be set by specifying a value (e.g. bounds=(None,10) means there is no lower bound, and an upper bound of 10). Bounds are inclusive by default, but exclusivity can be specified for each bound by setting inclusive_bounds (e.g. inclusive_bounds=(True,False) specifies an exclusive upper bound).
Number is also a type of Dynamic parameter, so its value can be set to a callable to get a dynamically generated number (see Dynamic).
When not being dynamically generated, bounds are checked when a Number is created or set. Using a default value outside the hard bounds, or one that is not numeric, results in an exception. When being dynamically generated, bounds are checked when a the value of a Number is requested. A generated value that is not numeric, or is outside the hard bounds, results in an exception.
As a special case, if allow_None=True (which is true by default if the parameter has a default of None when declared) then a value of None is also allowed.
A separate function set_in_bounds() is provided that will silently crop the given value into the legal range, for use in, for instance, a GUI.
softbounds are present to indicate the typical range of the parameter, but are not enforced. Setting the soft bounds allows, for instance, a GUI to know what values to display on sliders for the Number.
|
|||
|
Inherited from |
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Aug 5 14:59:20 2010 | http://epydoc.sourceforge.net |