Skip to content

Commit e6224d9

Browse files
result fields & unit test/code cleanup
1 parent 19ec4bb commit e6224d9

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

src/geophires_x/EconomicsAddOns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ def Calculate(self, model: Model) -> None:
317317
self.AdjustedProjectOPEX.value = model.economics.Coam.value + self.AddOnOPEXTotalPerYear.value
318318

319319
if is_sam_em:
320+
# SAM econ models incorporate add-ons into main economics, not as separate extended economics
320321
model.economics.CCap.value = self.AdjustedProjectCAPEX.value
321322
model.economics.Coam.value = self.AdjustedProjectOPEX.value
322-
# FIXME WIP
323323

324324
AddOnCapCostPerYear = self.AddOnCAPEXTotal.value / model.surfaceplant.construction_years.value
325325
ProjectCapCostPerYear = self.AdjustedProjectCAPEX.value / model.surfaceplant.construction_years.value

src/geophires_x_client/geophires_x_result.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ class GeophiresXResult:
261261
'Exploration costs',
262262
'Investment Tax Credit',
263263
'Inflation costs during construction',
264+
'Total Add-on CAPEX',
264265
'Total capital costs',
265266
'Annualized capital costs',
266267
# AGS/CLGS
@@ -289,6 +290,7 @@ class GeophiresXResult:
289290
'Average annual auxiliary fuel cost',
290291
'Average annual pumping cost',
291292
'Redrilling costs',
293+
'Total Add-on OPEX',
292294
'Total average annual O&M costs',
293295
'Total operating and maintenance costs',
294296
# AGS/CLGS

tests/geophires_x_tests/test_economics_sam.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -581,20 +581,24 @@ def test_add_ons(self):
581581
)
582582
self.assertIsNotNone(add_ons_result)
583583

584-
with open(add_ons_result.output_file_path, encoding='utf-8') as f:
585-
print('With Add-Ons:\n')
586-
print(f.read())
587-
print('\n------------\n')
588-
589-
with open(no_add_ons_result.output_file_path, encoding='utf-8') as f:
590-
print('Without Add-Ons:\n')
591-
print(f.read())
592-
print('\n------------\n')
593-
594-
# FIXME WIP
595-
self.assertLess(
596-
no_add_ons_result.result['SUMMARY OF RESULTS']['Total CAPEX']['value'],
584+
self.assertGreater(
597585
add_ons_result.result['SUMMARY OF RESULTS']['Total CAPEX']['value'],
586+
no_add_ons_result.result['SUMMARY OF RESULTS']['Total CAPEX']['value'],
587+
)
588+
589+
self.assertGreater(add_ons_result.result['CAPITAL COSTS (M$)']['Total Add-on CAPEX']['value'], 0)
590+
591+
self.assertGreater(
592+
add_ons_result.result['OPERATING AND MAINTENANCE COSTS (M$/yr)']['Total operating and maintenance costs'][
593+
'value'
594+
],
595+
no_add_ons_result.result['OPERATING AND MAINTENANCE COSTS (M$/yr)'][
596+
'Total operating and maintenance costs'
597+
]['value'],
598+
)
599+
600+
self.assertGreater(
601+
add_ons_result.result['OPERATING AND MAINTENANCE COSTS (M$/yr)']['Total Add-on OPEX']['value'], 0
598602
)
599603

600604
@staticmethod

0 commit comments

Comments
 (0)