@@ -470,10 +470,10 @@ def test_infer_aoi_model(location, system_no_aoi, aoi_model):
470
470
471
471
472
472
def test_infer_aoi_model_invalid (location , system_no_aoi ):
473
- with pytest .raises (ValueError ) as excinfo :
473
+ exc_text = 'could not infer AOI model'
474
+ with pytest .raises (ValueError , match = exc_text ):
474
475
ModelChain (system_no_aoi , location , orientation_strategy = 'None' ,
475
476
spectral_model = 'no_loss' )
476
- assert 'could not infer AOI model' in str (excinfo .value )
477
477
478
478
479
479
def constant_spectral_loss (mc ):
@@ -593,29 +593,26 @@ def test_deprecated_08():
593
593
module_parameters = {'R_sh_ref' : 1 , 'a_ref' : 1 , 'I_o_ref' : 1 ,
594
594
'alpha_sc' : 1 , 'I_L_ref' : 1 , 'R_s' : 1 }
595
595
# do not assign PVSystem.temperature_model_parameters
596
+ # leave out PVSystem.racking_model and PVSystem.module_type
596
597
system = PVSystem (module_parameters = module_parameters )
597
- with pytest .warns (pvlibDeprecationWarning ):
598
- ModelChain (system , location ,
599
- dc_model = 'desoto' ,
600
- aoi_model = 'no_loss' , spectral_model = 'no_loss' ,
601
- temp_model = 'sapm' ,
602
- ac_model = 'snlinverter' )
603
- system = PVSystem (module_parameters = module_parameters )
604
- with pytest .warns (pvlibDeprecationWarning ):
605
- ModelChain (system , location ,
606
- dc_model = 'desoto' ,
607
- aoi_model = 'no_loss' , spectral_model = 'no_loss' ,
608
- temperature_model = 'sapm' ,
609
- temp_model = 'sapm' ,
610
- ac_model = 'snlinverter' )
611
- system = PVSystem (module_parameters = module_parameters )
612
- with pytest .raises (ValueError ):
613
- ModelChain (system , location ,
614
- dc_model = 'desoto' ,
615
- aoi_model = 'no_loss' , spectral_model = 'no_loss' ,
616
- temperature_model = 'pvsyst' ,
617
- temp_model = 'sapm' ,
618
- ac_model = 'snlinverter' )
598
+ # deprecated temp_model kwarg
599
+ warn_txt = 'temp_model keyword argument is deprecated'
600
+ with pytest .warns (pvlibDeprecationWarning , match = warn_txt ):
601
+ ModelChain (system , location , dc_model = 'desoto' , aoi_model = 'no_loss' ,
602
+ spectral_model = 'no_loss' , ac_model = 'snlinverter' ,
603
+ temp_model = 'sapm' )
604
+ # provide both temp_model and temperature_model kwargs
605
+ warn_txt = 'Provide only one of temperature_model'
606
+ with pytest .warns (pvlibDeprecationWarning , match = warn_txt ):
607
+ ModelChain (system , location , dc_model = 'desoto' , aoi_model = 'no_loss' ,
608
+ spectral_model = 'no_loss' , ac_model = 'snlinverter' ,
609
+ temperature_model = 'sapm' , temp_model = 'sapm' )
610
+ # conflicting temp_model and temperature_model kwargs
611
+ exc_text = 'Conflicting temperature_model'
612
+ with pytest .raises (ValueError , match = exc_text ):
613
+ ModelChain (system , location , dc_model = 'desoto' , aoi_model = 'no_loss' ,
614
+ spectral_model = 'no_loss' , ac_model = 'snlinverter' ,
615
+ temperature_model = 'pvsyst' , temp_model = 'sapm' )
619
616
620
617
621
618
@requires_scipy
0 commit comments