@@ -520,6 +520,13 @@ def test_get_sky_diffuse_model_invalid():
520520 model = 'invalid' )
521521
522522
523+ def test_get_sky_diffuse_components_model_not_supported ():
524+ with pytest .raises (ValueError ):
525+ irradiance .get_sky_diffuse (
526+ 30 , 180 , 0 , 180 , 1000 , 1100 , 100 , dni_extra = 1360 , airmass = 1 ,
527+ model = 'klucher' , return_components = True )
528+
529+
523530def test_get_sky_diffuse_missing_dni_extra ():
524531 msg = 'dni_extra is required'
525532 with pytest .raises (ValueError , match = msg ):
@@ -575,7 +582,7 @@ def test_get_total_irradiance(irrad_data, ephem_data, dni_et,
575582
576583def test_get_total_irradiance_diffuse_components (irrad_data , ephem_data ,
577584 dni_et , relative_airmass ):
578- models = ['perez' , 'perez-driesse' ]
585+ models = ['reindl' , ' perez' , 'perez-driesse' ]
579586
580587 for model in models :
581588 total = irradiance .get_total_irradiance (
@@ -594,6 +601,23 @@ def test_get_total_irradiance_diffuse_components(irrad_data, ephem_data,
594601 'poa_isotropic' , 'poa_circumsolar' ,
595602 'poa_horizon' ]
596603
604+ for model in models :
605+ total = irradiance .get_total_irradiance (
606+ 32 , 180 ,
607+ ephem_data ['apparent_zenith' ].to_numpy (), ephem_data ['azimuth' ].to_numpy (),
608+ dni = irrad_data ['dni' ].to_numpy (), ghi = irrad_data ['ghi' ].to_numpy (),
609+ dhi = irrad_data ['dhi' ].to_numpy (),
610+ dni_extra = dni_et , airmass = relative_airmass ,
611+ model = model ,
612+ surface_type = 'urban' ,
613+ diffuse_components = True )
614+
615+ assert list (total .keys ()) == ['poa_global' , 'poa_direct' ,
616+ 'poa_diffuse' , 'poa_sky_diffuse' ,
617+ 'poa_ground_diffuse' ,
618+ 'poa_isotropic' , 'poa_circumsolar' ,
619+ 'poa_horizon' ]
620+
597621
598622@pytest .mark .parametrize ('model' , ['isotropic' , 'klucher' ,
599623 'haydavies' , 'reindl' , 'king' ,
0 commit comments