Skip to content

Commit

Permalink
correct capex discount rate
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorb1 committed Oct 4, 2024
1 parent 9bf8f89 commit 8ecec2f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/otoole/results/result_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,14 @@ def capital_investment(self) -> pd.DataFrame:
capital_cost = self["CapitalCost"]
new_capacity = self["NewCapacity"]
operational_life = self["OperationalLife"]
discount_rate = self["DiscountRate"]

if "DiscountRateIdv" in self.keys():
discount_rate = self["DiscountRateIdv"]
discount_rate_idv = self["DiscountRateIdv"]
if discount_rate_idv.empty:
discount_rate_idv = self["DiscountRate"]
else:
discount_rate = self["DiscountRate"]
discount_rate_idv = self["DiscountRate"]

regions = self["REGION"]["VALUE"].to_list()
technologies = self.get_unique_values_from_index(
Expand All @@ -326,7 +329,7 @@ def capital_investment(self) -> pd.DataFrame:
raise KeyError(self._msg("CapitalInvestment", str(ex)))

crf = capital_recovery_factor(
regions, technologies, discount_rate, operational_life
regions, technologies, discount_rate_idv, operational_life
)
pva = pv_annuity(regions, technologies, discount_rate, operational_life)
capital_investment = capital_cost.mul(new_capacity, fill_value=0.0)
Expand Down

0 comments on commit 8ecec2f

Please sign in to comment.