From 2702a7ad453236f14ca77e36cefe62245fc1e648 Mon Sep 17 00:00:00 2001 From: majidrezaei Date: Wed, 18 Dec 2024 09:31:30 -0500 Subject: [PATCH] fix: fix self_sufficiency to be a percentage of the total consumption --- pv_assessment/pv_system_assessment_with_lcoe.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pv_assessment/pv_system_assessment_with_lcoe.py b/pv_assessment/pv_system_assessment_with_lcoe.py index 3fecc3c4..d775fde9 100644 --- a/pv_assessment/pv_system_assessment_with_lcoe.py +++ b/pv_assessment/pv_system_assessment_with_lcoe.py @@ -164,17 +164,16 @@ class PvSystemAssessment: total_hourly_pv_output = [rooftops_pv_output[i] + facades_pv_output[i] for i in range(len(electricity_demand))] imported_electricity = [] exported_electricity = [] - self.building.self_sufficiency['hour'] = [] + self.building.self_sufficiency['percent'] = [] for i in range(len(electricity_demand)): transfer = total_hourly_pv_output[i] - electricity_demand[i] - self.building.self_sufficiency['hour'].append(transfer) if transfer > 0: exported_electricity.append(transfer) imported_electricity.append(0) else: exported_electricity.append(0) imported_electricity.append(abs(transfer)) - self.building.self_sufficiency['year'] = sum(self.building.self_sufficiency['hour']) + self.building.self_sufficiency['percent'] = sum(total_hourly_pv_output) / sum(electricity_demand) * 100 results = { 'building_name': self.building.name,