mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
constrain solar api to allow max 70% roof coverage
This commit is contained in:
parent
f67668eb41
commit
4b1dab4abe
1 changed files with 10 additions and 3 deletions
|
|
@ -17,6 +17,8 @@ class SolarPvRecommendations:
|
|||
MAX_SYSTEM_WATTAGE = 6000
|
||||
MIN_SYSTEM_WATTAGE = 1000
|
||||
|
||||
MAX_ROOF_AREA_PERCENTAGE = 0.7
|
||||
|
||||
def __init__(self, property_instance):
|
||||
"""
|
||||
:param property_instance: Instance of the Property class, for the home associated to property_id
|
||||
|
|
@ -189,15 +191,20 @@ class SolarPvRecommendations:
|
|||
)
|
||||
else:
|
||||
# TODO: There may be some instances where we don't want to use the solar API so we should cover for them
|
||||
panel_performance = self.property.solar_panel_configuration["panel_performance"]
|
||||
panel_performance = self.property.solar_panel_configuration["panel_performance"].copy()
|
||||
# We don't allow for more than 70% of the roof to be covered
|
||||
panel_performance = panel_performance[
|
||||
panel_performance["panneled_roof_area"] / self.property.roof_area <= self.MAX_ROOF_AREA_PERCENTAGE
|
||||
]
|
||||
|
||||
roof_area = self.property.roof_area
|
||||
solar_configurations = panel_performance.head(3).reset_index(drop=True)
|
||||
|
||||
# We combine each of these configurations with estimates with and without a battery
|
||||
for rank, recommendation_config in solar_configurations.iterrows():
|
||||
roof_coverage_percent = round(recommendation_config["panneled_roof_area"] / roof_area * 100)
|
||||
# We round up to the nearest 10
|
||||
roof_coverage_percent = np.ceil(roof_coverage_percent / 10) * 10
|
||||
# We round up to the nearest 5
|
||||
roof_coverage_percent = np.ceil(roof_coverage_percent / 5) * 5
|
||||
for has_battery in [False, True]:
|
||||
cost_result = self.costs.solar_pv(
|
||||
has_battery=has_battery,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue