Create a new value.
If the values value is not a numbers.Number unit and uncertainty are expected to be None.
| Parameters: |
|---|
Since values should be treated as immutable objects, the copy() method can be used instead of setting the attributes of the value.
Just assign a modified copy:
v = Value(10, unit="V")
v = v.copy(unit="mV")
| Parameters: | |
|---|---|
| Returns: | A (modified) copy of the value. |
Creates a value from all sorts of types of objects.
If the value is a sting like ‘10 +-0.001 mV’ it will be parsed to an equivalent of Value(10, 'mV', 0.001)
| Parameters: | thing – The object to create a value from. |
|---|---|
| Returns: | The created value object. |
| Return type: | Value |
| Raises: | ValueError if the object can’t be converted to a value. |
The name of the values data type.
| Type: | float |
|---|
| Type: | str |
|---|
| Type: | bool | float | int | str | datetime | time |
|---|