Skip to content

Commit

Permalink
Closes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
aalfonsi authored and aalfonsi committed Oct 10, 2023
1 parent 97e32db commit f60da78
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/CashFlows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,11 +1101,19 @@ def calculateCashflow(self, variables, lifetimeCashflows, lifetime, verbosity):
## FIXME what if I have set the values already?
# get variable values, if needed
need = {'alpha': self._alpha, 'driver': self._driver}

# load alpha, driver from variables if need be
need = self.loadFromVariables(need, variables, lifetimeCashflows, lifetime)
# for Capex, use m * alpha * (D/D')^X
alpha = need['alpha']
driver = need['driver']
# check if not-zero alpha > 1
maskAlpha = np.where(alpha != 0.0, )[0]
if len(maskAlpha) > 1:
if len(np.where(driver != 0.0, )[0]) == 1:
val = driver[np.where(driver != 0.0, )]
driver[maskAlpha] = val

reference = self.getParam('reference')
if reference is None:
reference = 1.0
Expand Down

0 comments on commit f60da78

Please sign in to comment.