Skip to content

Commit b41309f

Browse files
Fix CHP cost allocation output/parsing - include space between value and percent for consistency
1 parent c2464d1 commit b41309f

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

src/geophires_x/Outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ def PrintOutputs(self, model: Model):
16381638
EndUseOptions.COGENERATION_TOPPING_EXTRA_ELECTRICITY,
16391639
EndUseOptions.COGENERATION_BOTTOMING_EXTRA_ELECTRICITY,
16401640
EndUseOptions.COGENERATION_PARALLEL_EXTRA_ELECTRICITY]:
1641-
f.write(f' CHP: Percent cost allocation for electrical plant: {model.economics.CAPEX_heat_electricity_plant_ratio.value*100.0:10.2f}%' + NL)
1641+
f.write(f' CHP: Percent cost allocation for electrical plant: {model.economics.CAPEX_heat_electricity_plant_ratio.value*100.0:10.2f} %\n')
16421642

16431643
if model.surfaceplant.enduse_option.value in [EndUseOptions.ELECTRICITY]:
16441644
f.write(f' Estimated Jobs Created: {model.economics.jobs_created.value}\n')

tests/examples/example13.out

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

55
Simulation Metadata
66
----------------------
7-
GEOPHIRES Version: 3.4.34
8-
Simulation Date: 2024-06-19
9-
Simulation Time: 07:43
10-
Calculation Time: 0.034 sec
7+
GEOPHIRES Version: 3.4.37
8+
Simulation Date: 2024-06-24
9+
Simulation Time: 11:25
10+
Calculation Time: 0.037 sec
1111

1212
***SUMMARY OF RESULTS***
1313

@@ -35,7 +35,7 @@ Simulation Metadata
3535
Project VIR=PI=PIR: 0.21
3636
Project MOIC: -0.22
3737
Project Payback Period: N/A
38-
CHP: Percent cost allocation for electrical plant: 60.28%
38+
CHP: Percent cost allocation for electrical plant: 60.28 %
3939

4040
***ENGINEERING PARAMETERS***
4141

tests/examples/example3.out

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

55
Simulation Metadata
66
----------------------
7-
GEOPHIRES Version: 3.4.34
8-
Simulation Date: 2024-06-19
9-
Simulation Time: 07:43
10-
Calculation Time: 0.126 sec
7+
GEOPHIRES Version: 3.4.37
8+
Simulation Date: 2024-06-24
9+
Simulation Time: 11:25
10+
Calculation Time: 0.125 sec
1111

1212
***SUMMARY OF RESULTS***
1313

@@ -34,7 +34,7 @@ Simulation Metadata
3434
Project VIR=PI=PIR: 0.97
3535
Project MOIC: 0.64
3636
Project Payback Period: 14.84 yr
37-
CHP: Percent cost allocation for electrical plant: 93.48%
37+
CHP: Percent cost allocation for electrical plant: 93.48 %
3838

3939
***ENGINEERING PARAMETERS***
4040

tests/test_geophires_x_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,3 +496,9 @@ def assert_csv_equal(case_report_file_path, expected_csv_file_path):
496496
]:
497497
with self.subTest(msg=case[0]):
498498
assert_csv_equal(case[0], case[1])
499+
500+
def test_parse_chp_percent_cost_allocation(self):
501+
result = GeophiresXResult(self._get_test_file_path('examples/example3.out'))
502+
self.assertEqual(
503+
result.result['ECONOMIC PARAMETERS']['CHP: Percent cost allocation for electrical plant']['value'], 93.48
504+
)

0 commit comments

Comments
 (0)