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:

  1. "rolling": This key represents the rolling window size to be used when calculating statistics or aggregating data for the respective parameter or process variable.

  2. "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.

  3. "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 and quant_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 to quant_two.

Parameters
  • quant_one (int, float) – The first quantile value to validate.

  • quant_two (int, float) – The second quantile value to validate.

Returns

An error message string detailing any validation issues found. Returns an empty string if both quantile values are valid.

Return type

str

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

wip.files.rolling_limits.check_rolling_value(rolling: Any) str[source]#

Validate the rolling parameter.

This function checks if the provided rolling value is of the type integer and ensures it’s non-negative.

Parameters

rolling (int) – The rolling value to validate.

Returns

An error message string detailing any validation issues found. Returns an empty string if the rolling value is valid.

Return type

str