welltestpy.data.Variable
- class Variable(name, value, symbol='x', units='-', description='no description')[source]
Bases:
objectClass for a variable.
This is a class for a physical variable which is either a scalar or an array.
It has a name, a value, a symbol, a unit and a descrition string.
- Parameters
name (
str) – Name of the Variable.value (
intorfloatornumpy.ndarray) – Value of the Variable.symbole (
str, optional) – Name of the Variable. Default:"x"units (
str, optional) – Units of the Variable. Default:"-"description (
str, optional) – Description of the Variable. Default:"no description"
- Attributes
Methods
__call__([value])Call a variable.
save([path, name])Save a variable to file.
- __call__(value=None)[source]
Call a variable.
Here you can set a new value or you can get the value of the variable.
- Parameters
value (
intorfloatornumpy.ndarray,)optional – Value of the Variable. Default:
None
- Returns
value – Value of the Variable.
- Return type
intorfloatornumpy.ndarray
- save(path='', name=None)[source]
Save a variable to file.
This writes the variable to a csv file.
- Parameters
Notes
The file will get the suffix
".var".
- property value
Value.
- Type
intorfloatornumpy.ndarray