Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug_Fix: Property Recursion - Develop #361

Merged
merged 5 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions hopp/simulation/technologies/financial/custom_financial_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Outputs(FinancialData):
om_capacity_expense: float=None
om_fixed_expense: float=None
om_variable_expense: float=None
om_total_expense: float=None
om_total_expense: Sequence=None
levelized_cost_of_energy_real: float=None
levelized_cost_of_energy_nominal: float=None
total_revenue: float=None
Expand Down Expand Up @@ -259,7 +259,10 @@ def net_cash_flow(self, project_life=25):
ncf = list()
ncf.append(-self.value('total_installed_cost'))
degrad_fraction = 1 # fraction of annual energy after degradation
for year in range(1, project_life + 1):
om_costs = self.o_and_m_cost()
self.cf_operating_expenses = tuple(np.asarray([om_costs*(1 + self.value('inflation_rate') / 100)**(year - 1) for year in range(1, project_life+1)]))
self.cf_utility_bill = np.zeros_like(self.cf_operating_expenses) #TODO make it possible for this to be non-zero
for i, year in enumerate(range(1, project_life + 1)):
degrad_fraction *= (1 - degradation[year - 1])
ncf.append(
(
Expand Down Expand Up @@ -349,4 +352,18 @@ def export_battery_values(self):
@property
def annual_energy(self) -> float:
return self.value('annual_energy_pre_curtailment_ac')

@property
def om_total_expenses(self) -> Sequence:
return self.value('om_total_expense')

# for compatibility with calls to SingleOwner
@property
def lcoe_real(self) -> float:
return self.value('levelized_cost_of_energy_real')

# for compatibility with calls to SingleOwner
@property
def lcoe_nom(self) -> float:
return self.value('levelized_cost_of_energy_nominal')

Loading