Skip to content

Commit a782cd7

Browse files
test_royalty_rate_with_addon
1 parent 50e6f97 commit a782cd7

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/test_geophires_x.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import numpy as np
1111

12+
from geophires_x.GeoPHIRESUtils import sig_figs
1213
from geophires_x.OptionList import PlantType
1314
from geophires_x.OptionList import WellDrillingCostCorrelation
1415
from geophires_x_client import GeophiresXClient
@@ -1428,3 +1429,31 @@ def test_royalty_rate_escalation(self):
14281429

14291430
expected_last_year_revenue = ppa_revenue_MUSD[-1] * max_expected_rate
14301431
self.assertAlmostEqual(expected_last_year_revenue, royalties_cash_flow_MUSD[-1], places=3)
1432+
1433+
def test_royalty_rate_with_addon(self):
1434+
"""
1435+
Verifies that custom EXTENDED ECONOMICS header print logic in Outputs works as expected
1436+
(geophires_x.Outputs.Outputs._print_extended_economics_header)
1437+
"""
1438+
1439+
addon_profit_MUSD = 15
1440+
1441+
result = GeophiresXClient().get_geophires_result(
1442+
ImmutableGeophiresInputParameters(
1443+
from_file_path=self._get_test_file_path(
1444+
'examples/example_SAM-single-owner-PPA-4.txt' # Royalty rate example
1445+
),
1446+
params={
1447+
'AddOn Nickname 1': 'Waste Heat Absorption Chiller',
1448+
'AddOn CAPEX 1': 50,
1449+
'AddOn OPEX 1': 1,
1450+
'AddOn Profit Gained 1': addon_profit_MUSD,
1451+
},
1452+
)
1453+
)
1454+
1455+
self.assertEqual(30, sig_figs(result.result['EXTENDED ECONOMICS']['Royalty Holder NPV']['value'], 1))
1456+
1457+
addon_cash_flow = _cash_flow_profile_row(result.result['SAM CASH FLOW PROFILE'], 'Capacity payment revenue ($)')
1458+
self.assertEqual(0, addon_cash_flow[0])
1459+
self.assertTrue(all(it == addon_profit_MUSD * 1e6 for it in addon_cash_flow[1:]))

0 commit comments

Comments
 (0)