exosim.utils.checks#
Functions#
|
It checks the units of the inputs and returns the quantity rescaled to the desired units. |
|
Finds which key from key_list is contained in input_class_keys, ignoring case. |
|
Returns |
Module Contents#
- check_units(input_data, desired_units, calling_class=None, force=False)[source]#
It checks the units of the inputs and returns the quantity rescaled to the desired units.
- Parameters:
desired_units (
Quantity) – desired unit for the input qquantity.calling_class (
Logger(optional)) – calling class. This is needed to print the eventual debug message inside the calling class.force (bool (optional)) – if True, if the input data has no units, it assumes is expressed in the desired units. Default is False.
- Returns:
scaled input quantity.
- Return type:
- Raises:
UnitConversionError – if it cannot convert the original units into the desired ones