From ea50c6b856aea76fef25bf591d5e5649e80c9fd7 Mon Sep 17 00:00:00 2001
From: s_ranjbar <saeed.ranjbar@mail.concordia.ca>
Date: Wed, 27 Nov 2024 18:35:29 +0100
Subject: [PATCH] feat: installed_capacity attribute added to PvGeneration
 class and implemented in the code

---
 pv_assessment/pv_system_assessment.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pv_assessment/pv_system_assessment.py b/pv_assessment/pv_system_assessment.py
index de83b4fd..72e1a3ae 100644
--- a/pv_assessment/pv_system_assessment.py
+++ b/pv_assessment/pv_system_assessment.py
@@ -188,6 +188,11 @@ class PvSystemAssessment:
     archetype_name = '_'.join(system_archetype_name.lower().split())
     if 'grid_tied' in archetype_name:
       self.results = self.grid_tied_system()
+    for energy_system in self.building.energy_systems:
+      for generation_system in energy_system.generation_systems:
+        if generation_system.system_type == cte.PHOTOVOLTAIC:
+          generation_system.installed_capacity = (self.results['rooftop_panels'] *
+                                                  float(generation_system.standard_test_condition_maximum_power))
     hourly_pv_output = self.results['total_hourly_pv_system_output_W']
     self.building.pv_generation[cte.HOUR] = hourly_pv_output
     self.building.pv_generation[cte.MONTH] = MonthlyValues.get_total_month(hourly_pv_output)