Skip to content

Commit 96c858d

Browse files
Tweak name to 'After-tax IRR' for consistency with SAM name and existing GEOPHIRES hyphenated result fields. Result backwards compatibility maintained with previous capitalization
1 parent 4e78e11 commit 96c858d

File tree

8 files changed

+25
-17
lines changed

8 files changed

+25
-17
lines changed

src/geophires_x/EconomicsUtils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ def BuildPricingModel(plantlifetime: int, StartPrice: float, EndPrice: float,
3939

4040
def after_tax_irr_parameter() -> OutputParameter:
4141
return OutputParameter(
42-
Name='After-Tax IRR',
42+
Name='After-tax IRR',
4343
UnitType=Units.PERCENT,
4444
CurrentUnits=PercentUnit.PERCENT,
4545
PreferredUnits=PercentUnit.PERCENT,
46-
ToolTipText='The After-Tax IRR (internal rate of return) is the nominal discount rate that corresponds to '
46+
ToolTipText='The After-tax IRR (internal rate of return) is the nominal discount rate that corresponds to '
4747
'a net present value (NPV) of zero for PPA SAM Economic models. '
4848
'See https://samrepo.nrelcloud.org/help/mtf_irr.html.'
4949
)

src/geophires_x_client/geophires_x_result.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class GeophiresXResult:
7676
'Project NPV',
7777
'Project IRR',
7878
'After-Tax IRR',
79+
'After-tax IRR',
7980
'Project VIR=PI=PIR',
8081
'Project MOIC',
8182
'Fixed Charge Rate (FCR)', # SUTRA

src/geophires_x_schema_generator/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ def generate_json_schema(self) -> Tuple[dict, dict]:
140140
'properties': properties,
141141
}
142142

143-
return request_schema, self.get_result_json_schema(output_params_json)
143+
result_schema = self.get_result_json_schema(output_params_json)
144+
145+
return request_schema, result_schema
144146

145147
def get_result_json_schema(self, output_params_json) -> dict:
146148
properties = {}
@@ -165,6 +167,11 @@ def get_result_json_schema(self, output_params_json) -> dict:
165167
for field in GeophiresXResult._RESULT_FIELDS_BY_CATEGORY[category]:
166168
param_name = field if isinstance(field, str) else field.field_name
167169

170+
ignored_output_param_names = ['After-Tax IRR'] # Silently ignored in favor of "After-tax IRR"
171+
172+
if param_name in ignored_output_param_names:
173+
continue
174+
168175
if param_name in properties:
169176
_log.warning(f'Param {param_name} is already in properties: {properties[param_name]}')
170177

src/geophires_x_schema_generator/geophires-result.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@
102102
"description": "Project Internal Rate of Return",
103103
"units": "%"
104104
},
105-
"After-Tax IRR": {
105+
"After-tax IRR": {
106106
"type": "number",
107-
"description": "The After-Tax IRR (internal rate of return) is the nominal discount rate that corresponds to a net present value (NPV) of zero for PPA SAM Economic models. See https://samrepo.nrelcloud.org/help/mtf_irr.html.",
107+
"description": "The After-tax IRR (internal rate of return) is the nominal discount rate that corresponds to a net present value (NPV) of zero for PPA SAM Economic models. See https://samrepo.nrelcloud.org/help/mtf_irr.html.",
108108
"units": "%"
109109
},
110110
"Project VIR=PI=PIR": {

tests/examples/Fervo_Project_Cape-4.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Simulation Metadata
66
----------------------
77
GEOPHIRES Version: 3.9.10
88
Simulation Date: 2025-05-23
9-
Simulation Time: 10:35
9+
Simulation Time: 12:57
1010
Calculation Time: 1.052 sec
1111

1212
***SUMMARY OF RESULTS***
@@ -31,7 +31,7 @@ Simulation Metadata
3131
Project lifetime: 20 yr
3232
Capacity factor: 90.0 %
3333
Project NPV: 791.59 MUSD
34-
After-Tax IRR: 17.18 %
34+
After-tax IRR: 17.18 %
3535
Estimated Jobs Created: 1190
3636

3737
***ENGINEERING PARAMETERS***

tests/examples/example_SAM-single-owner-PPA-2.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
Simulation Metadata
66
----------------------
77
GEOPHIRES Version: 3.9.10
8-
Simulation Date: 2025-05-22
9-
Simulation Time: 07:11
10-
Calculation Time: 0.874 sec
8+
Simulation Date: 2025-05-23
9+
Simulation Time: 12:57
10+
Calculation Time: 0.879 sec
1111

1212
***SUMMARY OF RESULTS***
1313

@@ -31,7 +31,7 @@ Simulation Metadata
3131
Project lifetime: 20 yr
3232
Capacity factor: 90.0 %
3333
Project NPV: 2877.00 MUSD
34-
After-Tax IRR: 59.73 %
34+
After-tax IRR: 59.73 %
3535
Estimated Jobs Created: 976
3636

3737
***ENGINEERING PARAMETERS***

tests/examples/example_SAM-single-owner-PPA.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
Simulation Metadata
66
----------------------
77
GEOPHIRES Version: 3.9.10
8-
Simulation Date: 2025-05-21
9-
Simulation Time: 13:19
10-
Calculation Time: 1.058 sec
8+
Simulation Date: 2025-05-23
9+
Simulation Time: 12:57
10+
Calculation Time: 1.052 sec
1111

1212
***SUMMARY OF RESULTS***
1313

@@ -31,7 +31,7 @@ Simulation Metadata
3131
Project lifetime: 20 yr
3232
Capacity factor: 90.0 %
3333
Project NPV: 124.91 MUSD
34-
After-Tax IRR: 22.33 %
34+
After-tax IRR: 22.33 %
3535
Estimated Jobs Created: 125
3636

3737
***ENGINEERING PARAMETERS***

tests/test_geophires_x.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ def _sanitize_nan(self, r: GeophiresXResult) -> None:
254254
Workaround for float('nan') != float('nan')
255255
See https://stackoverflow.com/questions/51728427/unittest-how-to-assert-if-the-two-possibly-nan-values-are-equal
256256
257-
TODO generalize beyond After-Tax IRR
257+
TODO generalize beyond After-tax IRR
258258
"""
259-
irr_key = 'After-Tax IRR'
259+
irr_key = 'After-tax IRR'
260260
if irr_key in r.result['ECONOMIC PARAMETERS']:
261261
try:
262262
if math.isnan(r.result['ECONOMIC PARAMETERS'][irr_key]['value']):

0 commit comments

Comments
 (0)