added the lifetime kwh figures

This commit is contained in:
Khalim Conn-Kowlessar 2024-07-10 17:56:40 +01:00
parent 28c70d0afb
commit 09e5b01c7e

View file

@ -198,10 +198,11 @@ class GoogleSolarApi:
)
@staticmethod
def lifetime_production_ac_kwh(
def lifetime_production_kwh(
row,
efficiency_depreciation_factor,
installation_life_span
installation_life_span,
column_name="initial_ac_kwh_per_year"
):
"""
Mimics the function described in the Google Solar API documentation, presenting the lifetime production
@ -209,7 +210,7 @@ class GoogleSolarApi:
"""
return (
row["initial_ac_kwh_per_year"] *
row[column_name] *
(1 - pow(
efficiency_depreciation_factor,
installation_life_span)) /
@ -284,10 +285,19 @@ class GoogleSolarApi:
# 2) Calculate the liftime solar energy production
panel_performance['lifetime_ac_kwh'] = panel_performance.apply(
self.lifetime_production_ac_kwh,
self.lifetime_production_kwh,
axis=1,
efficiency_depreciation_factor=self.efficiency_depreciation_factor,
installation_life_span=self.installation_life_span
installation_life_span=self.installation_life_span,
column_name="initial_ac_kwh_per_year"
)
panel_performance['lifetime_dc_kwh'] = panel_performance.apply(
self.lifetime_production_kwh,
axis=1,
efficiency_depreciation_factor=self.efficiency_depreciation_factor,
installation_life_span=self.installation_life_span,
column_name="yearly_dc_energy",
)
# Now that we know the lifetime cnsumption of ac kwh, we can estimate the roi