Skip to content

Commit 1448731

Browse files
Change 'S_DAC_GT' to 'S-DAC-GT' in case report file and client parsing. Note that 'S_DAC_GT' remains in HTML output for now, since it may be in existing use, whereas the fields were missing entirely from the client until this patch version
1 parent 05b8886 commit 1448731

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

src/geophires_x/OutputsS_DAC_GT.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def PrintOutputs(self, model) -> tuple:
2727
sdac_results: list[OutputTableItem] = []
2828
f.write(NL)
2929
f.write(NL)
30-
f.write(" ***S_DAC_GT ECONOMICS***\n")
30+
f.write(" ***S-DAC-GT ECONOMICS***\n")
3131
f.write(NL)
3232
f.write(NL)
3333

@@ -83,9 +83,9 @@ def PrintOutputs(self, model) -> tuple:
8383

8484
f.write(NL)
8585
f.write(" **********************" + NL)
86-
f.write(" * S_DAC_GT PROFILE *" + NL)
86+
f.write(" * S-DAC-GT PROFILE *" + NL)
8787
f.write(" **********************" + NL)
88-
f.write("Year Carbon Cumm. Carbon S_DAC_GT S_DAC_GT Cumm. Cumm. Cost" + NL)
88+
f.write("Year Carbon Cumm. Carbon S-DAC-GT S-DAC-GT Cumm. Cumm. Cost" + NL)
8989
f.write("Since Captured Captured Annual Cost Cash Flow Cost Per Tonne" + NL)
9090
f.write("Start ("+model.sdacgteconomics.CarbonExtractedAnnually.PreferredUnits.value +
9191
") ("+model.sdacgteconomics.S_DAC_GTCummCarbonExtracted.PreferredUnits.value +

src/geophires_x_client/geophires_x_result.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ class GeophiresXResult:
9898
'Project MOIC (including carbon credit)',
9999
'Project Payback Period (including carbon credit)',
100100
],
101-
'S_DAC_GT ECONOMICS': [
101+
'S-DAC-GT ECONOMICS': [
102+
# TODO S-DAC-GT Report sub-titles as string value fields
102103
'LCOD Using grid-based electricity only',
103104
'LCOD Using natural gas only',
104105
'LCOD Using geothermal energy only',
@@ -373,7 +374,7 @@ def __init__(self, output_file_path, logger_name=None):
373374

374375
sdacgt_profile = self._get_sdacgt_profile()
375376
if sdacgt_profile is not None:
376-
self.result['S_DAC_GT PROFILE'] = sdacgt_profile
377+
self.result['S-DAC-GT PROFILE'] = sdacgt_profile
377378

378379
self.result['metadata'] = {'output_file_path': self.output_file_path}
379380
for metadata_field in GeophiresXResult._METADATA_FIELDS:
@@ -606,13 +607,13 @@ def extract_table_header(lines: list) -> list:
606607
'Year Since Start',
607608
'Carbon Captured (tonne/yr)',
608609
'Cumm. Carbon Captured (tonne)',
609-
'S_DAC_GT Annual Cost (USD/yr)',
610-
'S_DAC_GT Cumm. Cash Flow (USD)',
610+
'S-DAC-GT Annual Cost (USD/yr)',
611+
'S-DAC-GT Cumm. Cash Flow (USD)',
611612
'Cumm. Cost Per Tonne (USD/tonne)',
612613
]
613614

614615
try:
615-
lines = self._get_profile_lines('S_DAC_GT PROFILE')
616+
lines = self._get_profile_lines('S-DAC-GT PROFILE')
616617
profile = [extract_table_header(lines)]
617618
profile.extend(self._extract_addons_style_table_data(lines))
618619
return profile

tests/examples/S-DAC-GT.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
Simulation Metadata
66
----------------------
7-
GEOPHIRES Version: 3.7.13
7+
GEOPHIRES Version: 3.7.14
88
Simulation Date: 2025-02-27
9-
Simulation Time: 09:29
10-
Calculation Time: 0.099 sec
9+
Simulation Time: 09:55
10+
Calculation Time: 0.106 sec
1111

1212
***SUMMARY OF RESULTS***
1313

@@ -246,7 +246,7 @@ ________________________________________________________________________________
246246

247247

248248

249-
***S_DAC_GT ECONOMICS***
249+
***S-DAC-GT ECONOMICS***
250250

251251

252252
S-DAC-GT Report: Levelized Cost of Direct Air Capture (LCOD)
@@ -268,9 +268,9 @@ ________________________________________________________________________________
268268

269269

270270
**********************
271-
* S_DAC_GT PROFILE *
271+
* S-DAC-GT PROFILE *
272272
**********************
273-
Year Carbon Cumm. Carbon S_DAC_GT S_DAC_GT Cumm. Cumm. Cost
273+
Year Carbon Cumm. Carbon S-DAC-GT S-DAC-GT Cumm. Cumm. Cost
274274
Since Captured Captured Annual Cost Cash Flow Cost Per Tonne
275275
Start (tonne/yr) (tonne) (USD/yr) (USD) (USD/tonne)
276276
1 78,330.80 78,330.80 17,411,627.98 17,411,627.98 222.28

tests/test_geophires_x_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,20 +531,20 @@ def test_parse_annualized_capital_costs(self):
531531

532532
def test_parse_number_with_commas(self):
533533
result = GeophiresXResult(self._get_test_file_path('examples/S-DAC-GT.out'))
534-
self.assertEqual(result.result['S_DAC_GT ECONOMICS']['Total Cost of Capture']['value'], 499_311_405.59)
534+
self.assertEqual(result.result['S-DAC-GT ECONOMICS']['Total Cost of Capture']['value'], 499_311_405.59)
535535

536536
def test_parse_sdacgt_profile(self):
537537
result = GeophiresXResult(self._get_test_file_path('examples/S-DAC-GT.out'))
538-
sdacgt_profile = result.result['S_DAC_GT PROFILE']
538+
sdacgt_profile = result.result['S-DAC-GT PROFILE']
539539
self.assertIsNotNone(sdacgt_profile)
540540
self.assertEqual(
541541
sdacgt_profile[0],
542542
[
543543
'Year Since Start',
544544
'Carbon Captured (tonne/yr)',
545545
'Cumm. Carbon Captured (tonne)',
546-
'S_DAC_GT Annual Cost (USD/yr)',
547-
'S_DAC_GT Cumm. Cash Flow (USD)',
546+
'S-DAC-GT Annual Cost (USD/yr)',
547+
'S-DAC-GT Cumm. Cash Flow (USD)',
548548
'Cumm. Cost Per Tonne (USD/tonne)',
549549
],
550550
)

0 commit comments

Comments
 (0)