class | SciParam: |
Base class for scientific parameter. |
| name |
Name of parameter. |
| description |
Description of parameter or emtpy string. |
| unit |
Unit of parameter or empty string. |
| default |
Default value of parameter or None. |
| value |
Current value of parameter or None. |
| comment |
Comment about current parameter or empty string. |
| required |
Required flag: 0 or 1. |
| notunknown |
'unknown' is a disallowed value: 0 or 1. |
| unknown |
List of values which will be considered equivalent to status "unknown". |
|
| def | __init__(self, |
Create a SciParam object. |
| name, |
Set name from string. |
| description=None, |
Set description from string. |
| unit=None, |
Set unit from string. |
| default=None, |
Set default from string or from the same type as value is. |
| value=None, |
Set value from string or from native type. |
| comment=None, |
Set comment from string. |
| required=0, |
Set required flag to 0 or 1. |
| notunknown=0) |
Set notunknown flag to 0 or 1. |
|
| def | isvalid(self, |
Are values valid (or unknown) for this parameter? |
| *args) |
No argument: use value of current parameter; one argument: use this value; more arguments: currently not implemented. |
|
| def | isusual(self, |
Are values usual (or unknown) for this parameter? |
| *args) |
No argument: use value of current parameter; one argument: use this value; more arguments: currently not implemented. |
|
| def | isunknown(self, |
Are values unknown? |
| *args) |
No argument: use value of current parameter; one argument: use this value; more arguments: currently not implemented. |
|
| def | range(self) |
Return a string telling what kind of value is expected |
|
| def | convert(self, |
Convert string or number to internal representation (value or None); Return internal representation or raise ValueError. |
| value) |
Value to convert. |
|
| def | string(self, |
Convert internal representation to string; return "unknown" if value is in unknown. |
| value) |
Value to convert. |
|
| def | normalize(self, |
Convert string to normalized string; return either a string that is valid for convert() or default. |
| value, |
Value to convert. |
| default=None) |
Default to return if value is invalid. |
|
| def | __str__(self) |
Implements «str(parameter)»; return the string representation of the current value. |
class | FloatParam(SciParam): |
Float values with warning and error range.
Internal representation is: float or None |
| wrange |
Warning range object: values in this range are usual. |
| erange |
Error range object: values in this range are valid. |
|
| def | __init__(self, |
Create a FloatParam object. |
| name, |
Set name from string. |
| description=None, |
Set description from string. |
| unit=None, |
Set unit from string. |
| default=None, |
Set default from string or from the same type as value is. |
| value=None, |
Set value from string or from native type. |
| comment=None, |
Set comment from string. |
| required=0, |
Set required flag to 0 or 1. |
| notunknown=0, |
Set notunknown flag to 0 or 1. |
| wrange=None, |
Set wrange from string or range object. |
| erange=None) |
Set erange from string or range object. |
class | DistParam(FloatParam): |
Float values with warning/error range and optional distribution.
Internal representation is: (float, dist) or None
String representation is: "float" or "float;distvalue/disttype" |
| dist |
Distribution object: distribution of this value. |
|
| def | __init__(self, |
Create a DistParam object. |
| name, |
Set name from string. |
| description=None, |
Set description from string. |
| unit=None, |
Set unit from string. |
| default=None, |
Set default from string or from the same type as value is. |
| value=None, |
Set value from string or from native type. |
| comment=None, |
Set comment from string. |
| required=0, |
Set required flag to 0 or 1. |
| notunknown=0, |
Set notunknown flag to 0 or 1. |
| wrange=None, |
Set wrange from string or range object. |
| erange=None, |
Set erange from string or range object. |
| dist=None) |
Set distribution from string or distribution object. |
class | IntParam(FloatParam): |
Long integer values with warning and error range.
Internal representation is: long int or None |
| def | __init__(self, |
Create a IntParam object. |
| name, |
Set name from string. |
| description=None, |
Set description from string. |
| unit=None, |
Set unit from string. |
| default=None, |
Set default from string or from the same type as value is. |
| value=None, |
Set value from string or from native type. |
| comment=None, |
Set comment from string. |
| required=0, |
Set required flag to 0 or 1. |
| notunknown=0, |
Set notunknown flag to 0 or 1. |
| wrange=None, |
Set wrange from string or range object. |
| erange=None) |
Set erange from string or range object. |
class | ChoiceParam(SciParam): |
Values from a list of choices.
Internal representation is: (choice string, choice value) |
| choices |
List of 2-tuples (choice string, choice value). |
| long |
If 1: state that this will be a long list of choices. |
| unknown_yes_no |
Predefined choice list [("unknown", None), ("Yes", 1), ("No", 0)] |
| yes_no |
Predefined choice list [("Yes", 1), ("No", 0)] |
|
| def | __init__(self, |
Create a ChoiceParam object. |
| name, |
Set name from string. |
| description=None, |
Set description from string. |
| unit=None, |
Set unit from string. |
| default=None, |
Set default from string or from the same type as value is. |
| value=None, |
Set value from choice or value. |
| comment=None, |
Set comment from string. |
| required=0, |
Set required flag to 0 or 1. |
| notunknown=0, |
Set notunknown flag to 0 or 1. |
| choices=unknown_yes_no, |
Set choices from list of strings or list of 2-tuples (string, value). |
| long=0) |
Set long flag to 0 or 1. |