Skip to content

Commit 0929835

Browse files
assert royalty holder NPV
1 parent a002381 commit 0929835

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

tests/test_geophires_x.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@
77
from pathlib import Path
88
from typing import Any
99

10+
import numpy as np
11+
12+
# noinspection PyProtectedMember
13+
from geophires_x.EconomicsSam import _cash_flow_profile_row
1014
from geophires_x.OptionList import PlantType
1115
from geophires_x.OptionList import WellDrillingCostCorrelation
1216
from geophires_x_client import GeophiresXClient
1317
from geophires_x_client import GeophiresXResult
18+
19+
# noinspection PyProtectedMember
1420
from geophires_x_client import _get_logger
1521
from geophires_x_client.geophires_input_parameters import EndUseOption
1622
from geophires_x_client.geophires_input_parameters import GeophiresInputParameters
@@ -1306,7 +1312,9 @@ def test_royalty_rate(self):
13061312
from_file_path=self._get_test_file_path(
13071313
'geophires_x_tests/generic-egs-case-2_sam-single-owner-ppa.txt'
13081314
),
1309-
params={'Royalty Rate': royalty_rate},
1315+
params={
1316+
'Royalty Rate': royalty_rate,
1317+
},
13101318
)
13111319
)
13121320
opex_result = result.result['OPERATING AND MAINTENANCE COSTS (M$/yr)']
@@ -1332,7 +1340,22 @@ def test_royalty_rate(self):
13321340

13331341
if royalty_rate > 0.0:
13341342
self.assertEqual(58.88, opex_result[royalties_output_name]['value'])
1335-
self.assertGreater(royalty_holder_npv_MUSD, 0) # FIXME WIP
1336-
else:
1343+
self.assertGreater(royalty_holder_npv_MUSD, 0)
1344+
1345+
royalties_cash_flow_MUSD = [
1346+
it * 1e-6
1347+
for it in _cash_flow_profile_row(
1348+
result.result['SAM CASH FLOW PROFILE'], 'O&M production-based expense ($)'
1349+
)
1350+
]
1351+
1352+
self.assertAlmostEqual(
1353+
np.average(royalties_cash_flow_MUSD[1:]), opex_result[royalties_output_name]['value'], places=1
1354+
)
1355+
1356+
if royalty_rate == 0.1:
1357+
self.assertAlmostEqual(708.07, royalty_holder_npv_MUSD, places=2)
1358+
1359+
if royalty_rate == 0.0:
13371360
self.assertEqual(0, opex_result[royalties_output_name]['value'])
13381361
self.assertEqual(0, royalty_holder_npv_MUSD)

0 commit comments

Comments
 (0)