aquakin.KPIComparison#

class aquakin.KPIComparison(names, kpi_names, values)[source]#

Bases: object

A side-by-side KPI table over several named results.

The standardized-report companion to compare_scenarios(): where that runs a model and tabulates a fixed output vector, this assembles a table from heterogeneous report objects (a BSM2Evaluation, a CarbonFootprint, an OperatingCost, or any object exposing a kpis() mapping – or a plain {name: value} dict) already computed per scenario. The KPI columns are the union of every report’s keys, in first-seen order; a KPI a given report does not provide is left blank.

Variables:
  • names (list[str]) – The result names (table rows).

  • kpi_names (list[str]) – The KPI labels (table columns), union over all results.

  • values (dict) – name -> {kpi: value} for every result.

Parameters:
  • names (list[str])

  • kpi_names (list[str])

  • values (dict)

__init__(names, kpi_names, values)#
Parameters:
  • names (list[str])

  • kpi_names (list[str])

  • values (dict)

Return type:

None

Methods

__init__(names, kpi_names, values)

best(kpi, *[, minimize])

The result name with the lowest (or highest) value of kpi.

column(kpi)

The {name: value} map for one KPI across results.

table()

A human-readable KPI table, one column per result.

Attributes

names

kpi_names

values

column(kpi)[source]#

The {name: value} map for one KPI across results.

Parameters:

kpi (str)

Return type:

dict

best(kpi, *, minimize=True)[source]#

The result name with the lowest (or highest) value of kpi.

Parameters:
  • kpi (str)

  • minimize (bool)

Return type:

str

table()[source]#

A human-readable KPI table, one column per result.

Return type:

str