ComparisonTab package

Variant comparison module for district heating project analysis.

Provides automatic variant discovery, KPI dashboards, and comparative visualization of economic and technical metrics.

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

districtheatingsim.gui.ComparisonTab.comparison_tab.debug_print(msg)[source]

Print debug message with ProjectExplorer prefix.

Parameters:

msg (str) – Debug message

class districtheatingsim.gui.ComparisonTab.comparison_tab.ProjectExplorer(folder_manager, config_manager, parent=None)[source]

Bases: QWidget

Project explorer for automatic variant discovery and selection.

Scans project folder for available variants and allows multi-selection for comparison analysis.

variants_changed

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

__init__(folder_manager, config_manager, parent=None)[source]
initUI()[source]

Initialize project explorer UI.

set_base_path(base_path)[source]

Set base path and refresh project list.

Parameters:

base_path (str) – Project data base path

discover_projects()[source]

Discover and populate project variants.

Scans parent directory for variant folders and validates them.

validate_variant(variant_path)[source]

Validate if variant contains required data files.

Parameters:

variant_path (str) – Path to variant folder

Returns:

True if all required files exist

Return type:

bool

on_selection_changed(item, column)[source]

Handle variant selection changes in tree widget.

Parameters:
  • item (QTreeWidgetItem) – Changed tree item

  • column (int) – Column index

update_selected_variants()[source]

Update list of selected variants and emit signal.

Collects all checked variants and emits variants_changed signal.

class districtheatingsim.gui.ComparisonTab.comparison_tab.ComparisonDashboard(parent=None)[source]

Bases: QWidget

Dashboard widget showing comparison overview and KPIs.

Displays economic, environmental, and technical metrics across selected variants with interactive charts.

__init__(parent=None)[source]
initUI()[source]

Initialize dashboard UI.

create_kpi_section()[source]

Create KPI overview section.

create_kpi_widget(title, unit)[source]

Create individual KPI widget.

create_charts_section()[source]

Create charts section with tabbed organization.

update_dashboard(variant_data)[source]

Update dashboard with new variant data.

update_kpis()[source]

Update KPI widgets with current data.

update_charts()[source]

Update all comparison charts.

update_cost_chart()[source]

Update cost comparison chart.

get_clean_variant_name(full_name)[source]

Extract clean variant name from full project path name.

update_energy_chart()[source]

Update energy mix comparison chart.

update_co2_chart()[source]

Update CO2 emissions comparison chart.

update_pe_chart()[source]

Update Primärenergiefaktor comparison chart.

update_network_chart()[source]

Update network statistics chart with enhanced layout for larger space.

clear_dashboard()[source]

Clear all dashboard content.

class districtheatingsim.gui.ComparisonTab.comparison_tab.ComparisonTab(folder_manager, data_manager, config_manager, parent=None)[source]

Bases: QWidget

Comparison tab with comprehensive variant analysis.

Integrates project explorer, KPI dashboard, and comparative visualizations for multi-variant evaluation.

__init__(folder_manager, data_manager, config_manager, parent=None)[source]

Initialize comparison tab.

Parameters:
initUI()[source]

Initialize modern user interface.

create_comparison_content()[source]

Create main comparison content area.

Returns:

Content widget with dashboard tabs

Return type:

QWidget

on_variants_changed(selected_variants)[source]

Handle variant selection changes from explorer.

Parameters:

selected_variants (list) – List of selected variant info dicts

load_variant_data(selected_variants)[source]

Load data for selected variants.

Parameters:

selected_variants (list) – List of selected variant info dicts

load_network_data(variant_path)[source]

Load network KPI data from variant configuration.

Parameters:

variant_path (str) – Path to variant folder

Returns:

Network KPI data (length, losses, pump energy, building count)

Return type:

dict

process_variant_results(results)[source]

Process raw variant results for comparison.

Parameters:

results (dict) – Raw results from JSON file

Returns:

Processed results for dashboard display

Return type:

dict

Raises:

ValueError – If processing fails