@@ -414,16 +414,13 @@ def test_gen_egs_too_high_egs_plant_design_temp(sample_resource_data):
414
414
assert output not in gen .out
415
415
416
416
417
- @pytest .mark .parametrize (
418
- "sample_resource_data" ,
419
- [{"temp" : 200 * Geothermal .MAX_RT_TO_EGS_RATIO + 10 , "potential" : 20 }],
420
- indirect = True ,
421
- )
417
+ @pytest .mark .parametrize ("sample_resource_data" ,
418
+ [{"temp" : 310 , "potential" : 20 }], indirect = True )
422
419
def test_gen_egs_too_low_egs_plant_design_temp (sample_resource_data ):
423
420
"""Test generation for EGS too low plant design temp"""
424
421
points = slice (0 , 1 )
425
422
geo_sam_file , geo_res_file = sample_resource_data
426
- high_temp = 200 * Geothermal . MAX_RT_TO_EGS_RATIO + 10
423
+ high_temp = 310
427
424
428
425
with open (DEFAULT_GEO_SAM_FILE ) as fh :
429
426
geo_config = json .load (fh )
@@ -434,81 +431,69 @@ def test_gen_egs_too_low_egs_plant_design_temp(sample_resource_data):
434
431
with open (geo_sam_file , "w" ) as fh :
435
432
json .dump (geo_config , fh )
436
433
437
- output_request = ("design_temp" ,)
434
+ output_request = ("design_temp" , "cf_mean" )
438
435
with pytest .warns (UserWarning ):
439
- gen = Gen (
440
- "geothermal" ,
441
- points ,
442
- geo_sam_file ,
443
- geo_res_file ,
444
- output_request = output_request ,
445
- sites_per_worker = 1 ,
446
- scale_outputs = True ,
447
- )
436
+ gen = Gen ("geothermal" ,
437
+ points ,
438
+ geo_sam_file ,
439
+ geo_res_file ,
440
+ output_request = output_request ,
441
+ sites_per_worker = 1 ,
442
+ scale_outputs = True )
448
443
gen .run (max_workers = 1 )
449
444
450
- truth_vals = {"design_temp" : high_temp }
445
+ truth_vals = {"design_temp" : high_temp , "cf_mean" : 0.995 }
451
446
for dset in output_request :
452
447
truth = truth_vals [dset ]
453
448
test = gen .out [dset ]
454
449
if len (test .shape ) == 2 :
455
450
test = np .mean (test , axis = 0 )
456
451
457
- msg = (
458
- "{} outputs do not match baseline value! Values differ "
459
- "at most by: {}" .format (dset , np .max (np .abs (truth - test )))
460
- )
452
+ msg = ("{} outputs do not match baseline value! Values differ "
453
+ "at most by: {}" .format (dset , np .max (np .abs (truth - test ))))
461
454
assert np .allclose (truth , test , rtol = RTOL , atol = ATOL ), msg
462
455
463
456
for output in LCOE_REQUIRED_OUTPUTS :
464
457
assert output not in gen .out
465
458
466
459
467
- @pytest .mark .parametrize (
468
- "sample_resource_data" ,
469
- [{"temp" : 200 * Geothermal .MAX_RT_TO_EGS_RATIO - 1 , "potential" : 20 }],
470
- indirect = True ,
471
- )
472
- def test_gen_egs_plant_design_temp_adjusted_from_user (sample_resource_data ):
473
- """Test generation for user-requested match of EGS plant design and RT"""
460
+ @pytest .mark .parametrize ("sample_resource_data" ,
461
+ [{"temp" : 100 , "potential" : 20 }], indirect = True )
462
+ def test_gen_egs_too_high_egs_plant_design_temp (sample_resource_data ):
463
+ """Test generation for EGS too high plant design temp"""
474
464
points = slice (0 , 1 )
475
465
geo_sam_file , geo_res_file = sample_resource_data
476
- not_too_high_temp = 200 * Geothermal . MAX_RT_TO_EGS_RATIO - 1
466
+ not_too_high_temp = 100
477
467
478
468
with open (DEFAULT_GEO_SAM_FILE ) as fh :
479
469
geo_config = json .load (fh )
480
470
481
471
geo_config ["resource_depth" ] = 2000
482
472
geo_config ["resource_type" ] = 1
483
473
geo_config ["design_temp" ] = 200
484
- geo_config ["set_EGS_PDT_to_RT" ] = True
485
474
with open (geo_sam_file , "w" ) as fh :
486
475
json .dump (geo_config , fh )
487
476
488
- output_request = ("design_temp" ,)
477
+ output_request = ("design_temp" , "cf_mean" )
489
478
with pytest .warns (UserWarning ):
490
- gen = Gen (
491
- "geothermal" ,
492
- points ,
493
- geo_sam_file ,
494
- geo_res_file ,
495
- output_request = output_request ,
496
- sites_per_worker = 1 ,
497
- scale_outputs = True ,
498
- )
479
+ gen = Gen ("geothermal" ,
480
+ points ,
481
+ geo_sam_file ,
482
+ geo_res_file ,
483
+ output_request = output_request ,
484
+ sites_per_worker = 1 ,
485
+ scale_outputs = True )
499
486
gen .run (max_workers = 1 )
500
487
501
- truth_vals = {"design_temp" : not_too_high_temp }
488
+ truth_vals = {"design_temp" : not_too_high_temp , "cf_mean" : 0.995 }
502
489
for dset in output_request :
503
490
truth = truth_vals [dset ]
504
491
test = gen .out [dset ]
505
492
if len (test .shape ) == 2 :
506
493
test = np .mean (test , axis = 0 )
507
494
508
- msg = (
509
- "{} outputs do not match baseline value! Values differ "
510
- "at most by: {}" .format (dset , np .max (np .abs (truth - test )))
511
- )
495
+ msg = ("{} outputs do not match baseline value! Values differ "
496
+ "at most by: {}" .format (dset , np .max (np .abs (truth - test ))))
512
497
assert np .allclose (truth , test , rtol = RTOL , atol = ATOL ), msg
513
498
514
499
for output in LCOE_REQUIRED_OUTPUTS :
0 commit comments