@@ -470,10 +470,10 @@ def test_infer_aoi_model(location, system_no_aoi, aoi_model):
470470
471471
472472def 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 ):
474475 ModelChain (system_no_aoi , location , orientation_strategy = 'None' ,
475476 spectral_model = 'no_loss' )
476- assert 'could not infer AOI model' in str (excinfo .value )
477477
478478
479479def constant_spectral_loss (mc ):
@@ -593,29 +593,26 @@ def test_deprecated_08():
593593 module_parameters = {'R_sh_ref' : 1 , 'a_ref' : 1 , 'I_o_ref' : 1 ,
594594 'alpha_sc' : 1 , 'I_L_ref' : 1 , 'R_s' : 1 }
595595 # do not assign PVSystem.temperature_model_parameters
596+ # leave out PVSystem.racking_model and PVSystem.module_type
596597 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' )
619616
620617
621618@requires_scipy
0 commit comments