@@ -1305,6 +1305,21 @@ def test_temperature_model_inconsistent(location, sapm_dc_snl_ac_system):
1305
1305
spectral_model = 'no_loss' , temperature_model = 'pvsyst' )
1306
1306
1307
1307
1308
+ def test_temperature_model_not_specified ():
1309
+ # GH 1759 -- ensure correct error is raised when temperature model params
1310
+ # are specified on the PVSystem instead of the Arrays
1311
+ location = Location (latitude = 32.2 , longitude = - 110.9 )
1312
+ arrays = [pvsystem .Array (pvsystem .FixedMount (),
1313
+ module_parameters = {'pdc0' : 1 , 'gamma_pdc' : 0 })]
1314
+ system = pvsystem .PVSystem (arrays ,
1315
+ temperature_model_parameters = {'u0' : 1 , 'u1' : 1 },
1316
+ inverter_parameters = {'pdc0' : 1 })
1317
+ with pytest .raises (ValueError ,
1318
+ match = 'could not infer temperature model '
1319
+ 'from system.temperature_model_parameters' ):
1320
+ _ = ModelChain (system , location ,
1321
+ aoi_model = 'no_loss' , spectral_model = 'no_loss' )
1322
+
1308
1323
def test_dc_model_user_func (pvwatts_dc_pvwatts_ac_system , location , weather ,
1309
1324
mocker ):
1310
1325
m = mocker .spy (sys .modules [__name__ ], 'poadc' )
0 commit comments