Redispatch Analysis#

Utilities for loading and validating redispatch cost and volume metrics.

API path: apem.unit_based_model.evaluation.redispatch_analysis

Utilities for loading and validating redispatch cost and volume metrics.

load_redispatch_metric_file(path, *, redispatch_algorithm=None, metric=None)[source]#

Load one redispatch metric file and normalize it to tabular format.

The file is expected to contain one <label>: <value> line.

Parameters:
  • path (str | Path) – redispatch metric file path

  • redispatch_algorithm (str | None) – algorithm label override; inferred from the file name when omitted

  • metric (str | None) – metric label override (for example costs or volumes); inferred from the file name when omitted

Returns:

validated one-row table with redispatch_algorithm, metric, value

Raises:

ValueError – if parsing fails or inferred values are invalid

Return type:

DataFrame

validate_redispatch_table(df)[source]#

Validate and normalize a generic redispatch-analysis input table.

Parameters:

df (DataFrame) – input table expected to contain redispatch_algorithm, metric, and value

Returns:

normalized copy with lowercase metric labels and numeric value

Raises:

ValueError – if required columns are missing, metric values are unsupported, algorithm labels are empty, or no numeric values are available

Return type:

DataFrame