@@ -366,3 +366,37 @@ def test_vapor_pressure_above_critical_temperature(self):
366
366
result = GeophiresXClient ().get_geophires_result (input_params )
367
367
self .assertIsNotNone (result )
368
368
self .assertIn ('SUMMARY OF RESULTS' , result .result )
369
+
370
+ def test_heat_price (self ):
371
+ def input_for_heat_prices (params ) -> GeophiresInputParameters :
372
+ return GeophiresInputParameters (
373
+ from_file_path = self ._get_test_file_path ('examples/example1.txt' ), params = params
374
+ )
375
+
376
+ result_escalating = GeophiresXClient ().get_geophires_result (
377
+ input_for_heat_prices ({'Starting Heat Sale Price' : 0.015 , 'Ending Heat Sale Price' : 0.015 })
378
+ )
379
+ self .assertIsNotNone (result_escalating )
380
+ cashflow_constant = result_escalating .result ['REVENUE & CASHFLOW PROFILE' ]
381
+ self .assertEqual (cashflow_constant [0 ][4 ], 'Heat Price (cents/kWh)' )
382
+
383
+ # First entry (index 1 - header is index 0) is hardcoded to zero per
384
+ # https://github.com/NREL/GEOPHIRES-X/blob/becec79cc7510a35f7a9cb01127dabc829720015/src/geophires_x/Economics.py#L2920-L2925
385
+ # so start test at index 2.
386
+ for i in range (2 , len (cashflow_constant [0 ])):
387
+ self .assertEqual (cashflow_constant [i ][4 ], 1.5 )
388
+
389
+ result_escalating = GeophiresXClient ().get_geophires_result (
390
+ input_for_heat_prices (
391
+ {
392
+ 'Starting Heat Sale Price' : 0.015 ,
393
+ 'Ending Heat Sale Price' : 0.030 ,
394
+ 'Heat Escalation Rate Per Year' : 0.005 ,
395
+ 'Heat Escalation Start Year' : 0 ,
396
+ }
397
+ )
398
+ )
399
+ cashflow_escalating = result_escalating .result ['REVENUE & CASHFLOW PROFILE' ]
400
+
401
+ self .assertEqual (cashflow_escalating [2 ][4 ], 1.5 )
402
+ self .assertEqual (cashflow_escalating [- 1 ][4 ], 3.0 )
0 commit comments