rolling_limits#
The dictionary rolling_limits
has key-value pairs where each key is
a string representing a parameter or process variable, and each value is another
dictionary with three key-value pairs:
"rolling"
: This key represents the rolling window size to be used when calculating statistics or aggregating data for the respective parameter or process variable."quant_one"
: This key is associated with a float value (between 0 and 1), representing the lower quantile value for the respective parameter or process variable. It determines thresholds to use when calculating the data ranges."quant_two"
: This key is associated with a float value (between 0 and 1), representing the upper quantile value for the respective parameter or process variable. It determines thresholds to calculate data ranges.
- wip.files.rolling_limits.check_quantile_values(quant_one: Any, quant_two: Any) str [source]#
Validate
quant_one
andquant_two
quantile values.This function checks if the provided quantile values are of a valid type (int or float), are within the range [0, 1], and ensures that
quant_one
is less than or equal toquant_two
.
- wip.files.rolling_limits.check_rolling_limits_values(rolling_limits_dict: dict)[source]#
Check if the
rolling_limits_dict
has the correct keys and values.The function runs inside this module and ensures that the
rolling_limits
dictionary doesn’t contain errors that can cause the optimization model to output wrong results.- Parameters
rolling_limits_dict (
dict
) – Dictionary containing the rolling limits for each tag.- Raises
TypeError – If the value of any tag isn’t a dictionary.
ValueError – If values from each tag inner dictionary have the wrong type, or are out of their respective ranges.
KeyError –
If any tag is missing one of the necessary keys:
rolling
quant_one
quant_two