Skip to content

Commit

Permalink
specify builing names due to problems when having more then 10 buildings
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoppe-J committed Sep 3, 2024
1 parent 06861c4 commit a9ff292
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hisim/postprocessing/kpi_computation/kpi_preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def filter_results_according_to_postprocessing_flags(
output: ComponentOutput

for index, output in enumerate(all_outputs):
if (building_objects_in_district in str(output.get_pretty_name()) or
if (building_objects_in_district == output.component_name.split("_")[0] or
not self.simulation_parameters.multiple_buildings):
if output.postprocessing_flag is not None:
if InandOutputType.ELECTRICITY_PRODUCTION in output.postprocessing_flag:
Expand Down Expand Up @@ -416,8 +416,8 @@ def get_electricity_to_and_from_grid_from_electricty_meter(
if (
isinstance(kpi_entry["description"], str)
and ElectricityMeter.get_classname() in kpi_entry["description"]
and building_objects_in_district == kpi_entry["description"].split("_")[0]
):

if kpi_entry["name"] == "Total energy from grid" and kpi_entry["unit"] == "kWh":
total_energy_from_grid_in_kwh = kpi_entry["value"]
elif kpi_entry["name"] == "Total energy to grid" and kpi_entry["unit"] == "kWh":
Expand Down Expand Up @@ -1473,7 +1473,7 @@ def create_overall_district_contracting_collection(self, district_name, all_outp
set_of_buildings_in_contracting = set()
for building_objekt in self.building_objects_in_district_list:
for output in all_outputs:
if building_objekt in output.component_name and district_name in output.component_name:
if building_objekt == output.component_name.split("_")[0] and district_name in output.component_name:
set_of_buildings_in_contracting.add(building_objekt)

if district_name in set_of_buildings_in_contracting:
Expand Down Expand Up @@ -1606,7 +1606,7 @@ def get_all_component_kpis(self, wrapped_components: List[ComponentWrapper]) ->
for kpi_entry in my_component_kpi_entry_list:

for object_name in self.kpi_collection_dict_unsorted.keys():
if (object_name in my_component.component_name or
if (object_name == my_component.component_name.split("_")[0] or
not self.simulation_parameters.multiple_buildings):
self.kpi_collection_dict_unsorted[object_name][kpi_entry.name] = kpi_entry.to_dict()
break
Expand Down

0 comments on commit a9ff292

Please sign in to comment.