Skip to content

Commit 33305bb

Browse files
Workaround attempt for possible float issue encountered on python 3.9 on Windows in GitHub actions https://github.com/NREL/GEOPHIRES-X/actions/runs/15422135188/job/43399762653
1 parent e8efadd commit 33305bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/geophires_x/EconomicsSam.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ def _calculate_nominal_discount_rate_and_wacc(model: Model, single_owner: Single
219219

220220
def _calculate_moic(cash_flow: list[list[Any]], model) -> float | None:
221221
try:
222-
total_capital_invested_USD = _cash_flow_profile_row(cash_flow, 'Issuance of equity ($)')[0]
223-
total_value_received_from_investment_USD = np.sum(
224-
_cash_flow_profile_row(cash_flow, 'Total pre-tax returns ($)')
222+
total_capital_invested_USD = Decimal(_cash_flow_profile_row(cash_flow, 'Issuance of equity ($)')[0])
223+
total_value_received_from_investment_USD = Decimal(
224+
float(np.sum(_cash_flow_profile_row(cash_flow, 'Total pre-tax returns ($)')))
225225
)
226-
return total_value_received_from_investment_USD / total_capital_invested_USD
226+
return float(total_value_received_from_investment_USD / total_capital_invested_USD)
227227
except Exception as e:
228228
model.logger.error(f'Encountered exception calculating MOIC: {e}')
229229
return None

0 commit comments

Comments
 (0)