From ec6fc84911d1a8ac3689c9f07b866fda98086212 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 5 Apr 2024 15:14:55 +0100 Subject: [PATCH] updating solar panel logic --- recommendations/SolarPvRecommendations.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/recommendations/SolarPvRecommendations.py b/recommendations/SolarPvRecommendations.py index 744351be..4cf1c1fc 100644 --- a/recommendations/SolarPvRecommendations.py +++ b/recommendations/SolarPvRecommendations.py @@ -8,8 +8,8 @@ class SolarPvRecommendations: # Wattage per panel - this is based on the average wattage of a solar panel being between 250w and 420w SOLAR_PANEL_WATTAGE = 250 - MAX_SYSTEM_WATTAGE = 4200 - MIN_SYSTEM_WATTAGE = 2500 + MAX_SYSTEM_WATTAGE = 6000 + MIN_SYSTEM_WATTAGE = 1000 def __init__(self, property_instance): """ @@ -60,8 +60,9 @@ class SolarPvRecommendations: # 2) With and without battery roof_coverage_scenarios = [ self.property.solar_pv_percentage - 0.1, self.property.solar_pv_percentage, - self.property.solar_pv_percentage + 0.1 ] + if self.property.solar_pv_percentage <= 0.4: + roof_coverage_scenarios.append(self.property.solar_pv_percentage + 0.1) # We make sure we haven't gone too low or high - we allow no more than 60% coverage roof_coverage_scenarios = [v for v in roof_coverage_scenarios if 0 <= v <= 0.6] # If we only have two scenarios, we add a coverage scenario 10% less than the smallest @@ -76,6 +77,10 @@ class SolarPvRecommendations: number_solar_panels = np.floor(solar_pv_roof_area / self.SOLAR_PANEL_AREA) solar_panel_wattage = number_solar_panels * self.SOLAR_PANEL_WATTAGE + + if solar_panel_wattage < self.MIN_SYSTEM_WATTAGE: + continue + solar_panel_wattage = np.clip( a=solar_panel_wattage, a_min=self.MIN_SYSTEM_WATTAGE, a_max=self.MAX_SYSTEM_WATTAGE )