hestia_earth.validation.validators.shared.is_value_different¶
-
hestia_earth.validation.validators.shared.is_value_different(value, expected_value, delta=0.05)[source]¶ Check the difference in percentage between a value and the expected value.
- Parameters:
value (float) – The value to check.
expected_value (float) – The value it should be close to.
delta (float) – The accepted difference between the value and the expected one. Defaults to 5%.
- Returns:
True if the value is within the percentage of the expected value, False otherwise.
- Return type:
bool