@@ -138,6 +138,18 @@ def pvwatts_dc_pvwatts_ac_pvsyst_temp_system():
138138 return system
139139
140140
141+ @pytest .fixture (scope = "function" )
142+ def pvwatts_dc_pvwatts_ac_fuentes_temp_system ():
143+ module_parameters = {'pdc0' : 220 , 'gamma_pdc' : - 0.003 }
144+ temp_model_params = {'noct_installed' : 45 }
145+ inverter_parameters = {'pdc0' : 220 , 'eta_inv_nom' : 0.95 }
146+ system = PVSystem (surface_tilt = 32.2 , surface_azimuth = 180 ,
147+ module_parameters = module_parameters ,
148+ temperature_model_parameters = temp_model_params ,
149+ inverter_parameters = inverter_parameters )
150+ return system
151+
152+
141153@pytest .fixture (scope = "function" )
142154def system_no_aoi (cec_module_cs5p_220m , sapm_temperature_cs5p_220m ,
143155 cec_inverter_parameters ):
@@ -317,6 +329,23 @@ def test_run_model_with_weather_faiman_temp(sapm_dc_snl_ac_system, location,
317329 assert not mc .ac .empty
318330
319331
332+ def test_run_model_with_weather_fuentes_temp (sapm_dc_snl_ac_system , location ,
333+ weather , mocker ):
334+ weather ['wind_speed' ] = 5
335+ weather ['temp_air' ] = 10
336+ sapm_dc_snl_ac_system .temperature_model_parameters = {
337+ 'noct_installed' : 45
338+ }
339+ mc = ModelChain (sapm_dc_snl_ac_system , location )
340+ mc .temperature_model = 'fuentes'
341+ m_fuentes = mocker .spy (sapm_dc_snl_ac_system , 'fuentes_celltemp' )
342+ mc .run_model (weather )
343+ assert m_fuentes .call_count == 1
344+ assert_series_equal (m_fuentes .call_args [0 ][1 ], weather ['temp_air' ])
345+ assert_series_equal (m_fuentes .call_args [0 ][2 ], weather ['wind_speed' ])
346+ assert not mc .ac .empty
347+
348+
320349def test_run_model_tracker (sapm_dc_snl_ac_system , location , weather , mocker ):
321350 system = SingleAxisTracker (
322351 module_parameters = sapm_dc_snl_ac_system .module_parameters ,
@@ -479,14 +508,16 @@ def test_infer_spectral_model(location, sapm_dc_snl_ac_system,
479508
480509
481510@pytest .mark .parametrize ('temp_model' , [
482- 'sapm_temp' , 'faiman_temp' , 'pvsyst_temp' ])
511+ 'sapm_temp' , 'faiman_temp' , 'pvsyst_temp' , 'fuentes_temp' ])
483512def test_infer_temp_model (location , sapm_dc_snl_ac_system ,
484513 pvwatts_dc_pvwatts_ac_pvsyst_temp_system ,
485514 pvwatts_dc_pvwatts_ac_faiman_temp_system ,
515+ pvwatts_dc_pvwatts_ac_fuentes_temp_system ,
486516 temp_model ):
487517 dc_systems = {'sapm_temp' : sapm_dc_snl_ac_system ,
488518 'pvsyst_temp' : pvwatts_dc_pvwatts_ac_pvsyst_temp_system ,
489- 'faiman_temp' : pvwatts_dc_pvwatts_ac_faiman_temp_system }
519+ 'faiman_temp' : pvwatts_dc_pvwatts_ac_faiman_temp_system ,
520+ 'fuentes_temp' : pvwatts_dc_pvwatts_ac_fuentes_temp_system }
490521 system = dc_systems [temp_model ]
491522 mc = ModelChain (system , location ,
492523 orientation_strategy = 'None' , aoi_model = 'physical' ,
0 commit comments