Skip to content

Commit 8af6e17

Browse files
Assert that opex line items, including royalties, sum up to total
1 parent 11c3314 commit 8af6e17

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/geophires_x/Economics.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,8 +2507,6 @@ def Calculate(self, model: Model) -> None:
25072507
self.CCap.value = (self.sam_economics_calculations.capex.quantity()
25082508
.to(self.CCap.CurrentUnits.value).magnitude)
25092509

2510-
# FIXME WIP adjust OPEX for royalties
2511-
# FIXME WIP unit conversion
25122510
average_annual_royalties = np.average(self.sam_economics_calculations.royalties_opex[1:]) # ignore Year 0
25132511
if average_annual_royalties > 0:
25142512
self.royalties_opex.value = average_annual_royalties

tests/test_geophires_x.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,18 @@ def test_royalty_rate(self):
13121312
self.assertIsNotNone(opex_result[royalties_output_name])
13131313
self.assertEqual(58.88, opex_result[royalties_output_name]['value'])
13141314
self.assertEqual('MUSD/yr', opex_result[royalties_output_name]['unit'])
1315-
# FIXME WIP assert total opex includes royalties
1315+
1316+
total_opex_MUSD = opex_result['Total operating and maintenance costs']['value']
1317+
1318+
opex_line_item_sum = 0
1319+
for line_item_names in [
1320+
'Wellfield maintenance costs',
1321+
'Power plant maintenance costs',
1322+
'Water costs',
1323+
royalties_output_name,
1324+
]:
1325+
opex_line_item_sum += opex_result[line_item_names]['value']
1326+
1327+
self.assertEqual(opex_line_item_sum, total_opex_MUSD)
13161328
else:
13171329
self.assertIsNone(opex_result[royalties_output_name])

0 commit comments

Comments
 (0)