Skip to content

Commit d3012f8

Browse files
Don't override 'Do AddOn Calculations' automatically if it was explicitly provided
1 parent 490b9d8 commit d3012f8

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/geophires_x/Economics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2334,7 +2334,7 @@ def _warn(_msg: str) -> None:
23342334

23352335
# we can determine on-the-fly if Addons, CCUS, or S-DAC-GT are being used in the user input file
23362336
for key in model.InputParameters.keys():
2337-
if key.startswith("AddOn"):
2337+
if key.startswith("AddOn") and not self.DoAddOnCalculations.Provided:
23382338
self.DoAddOnCalculations.value = True
23392339
break
23402340

tests/geophires_x_tests/egs-sam-em-add-ons.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ Production Flow Rate per Well, 80
6060

6161

6262
# AddOns
63-
Do AddOn Calculations, True
6463
AddOn Nickname 1, Desalinization
6564
AddOn CAPEX 1, 562
6665
AddOn OPEX 1, 0.1

tests/geophires_x_tests/test_economics_sam.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,9 @@ def _accrued_financing(_r: GeophiresXResult) -> float:
573573
# self.assertEqual(15.0, _accrued_financing(r4))
574574

575575
def test_add_ons(self):
576-
add_ons_result = self._get_result({}, file_path=self._get_test_file_path('egs-sam-em-add-ons.txt'))
576+
add_ons_result = self._get_result(
577+
{'Do AddOn Calculations': True}, file_path=self._get_test_file_path('egs-sam-em-add-ons.txt')
578+
)
577579
no_add_ons_result = self._get_result(
578580
{'Do AddOn Calculations': False}, file_path=self._get_test_file_path('egs-sam-em-add-ons.txt')
579581
)

0 commit comments

Comments
 (0)