@@ -787,7 +787,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
787787
788788 Returns
789789 --------
790- numeric, OrderedDict , or DataFrame
790+ numeric, dict , or DataFrame
791791 Return type controlled by ``return_components`` argument.
792792 If `False`, ``sky_diffuse`` is returned.
793793 If `True`, ``diffuse_components`` is returned.
@@ -796,13 +796,11 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
796796 The sky diffuse component of the solar radiation on a tilted
797797 surface. [Wm⁻²]
798798
799- diffuse_components : OrderedDict (array input) or DataFrame (Series input)
799+ diffuse_components : dict (array input) or DataFrame (Series input)
800800 Keys/columns are:
801801 * poa_sky_diffuse: Total sky diffuse
802802 * poa_isotropic
803803 * poa_circumsolar
804- * poa_horizon (always zero, not accounted for by the
805- Hay-Davies model)
806804
807805 Notes
808806 ------
@@ -860,14 +858,11 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
860858 sky_diffuse = poa_isotropic + poa_circumsolar
861859
862860 if return_components :
863- diffuse_components = OrderedDict ()
864- diffuse_components ['poa_sky_diffuse' ] = sky_diffuse
865-
866- # Calculate the individual components
867- diffuse_components ['poa_isotropic' ] = poa_isotropic
868- diffuse_components ['poa_circumsolar' ] = poa_circumsolar
869- diffuse_components ['poa_horizon' ] = np .where (
870- np .isnan (diffuse_components ['poa_isotropic' ]), np .nan , 0. )
861+ diffuse_components = {
862+ 'poa_sky_diffuse' : sky_diffuse ,
863+ 'poa_isotropic' : poa_isotropic ,
864+ 'poa_circumsolar' : poa_circumsolar
865+ }
871866
872867 if isinstance (sky_diffuse , pd .Series ):
873868 diffuse_components = pd .DataFrame (diffuse_components )
@@ -1109,7 +1104,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
11091104
11101105 Returns
11111106 --------
1112- numeric, OrderedDict , or DataFrame
1107+ numeric, dict , or DataFrame
11131108 Return type controlled by `return_components` argument.
11141109 If ``return_components=False``, `sky_diffuse` is returned.
11151110 If ``return_components=True``, `diffuse_components` is returned.
@@ -1118,7 +1113,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
11181113 The sky diffuse component of the solar radiation on a tilted
11191114 surface.
11201115
1121- diffuse_components : OrderedDict (array input) or DataFrame (Series input)
1116+ diffuse_components : dict (array input) or DataFrame (Series input)
11221117 Keys/columns are:
11231118 * poa_sky_diffuse: Total sky diffuse
11241119 * poa_isotropic
@@ -1205,13 +1200,12 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
12051200 sky_diffuse = np .where (np .isnan (airmass ), 0 , sky_diffuse )
12061201
12071202 if return_components :
1208- diffuse_components = OrderedDict ()
1209- diffuse_components ['poa_sky_diffuse' ] = sky_diffuse
1210-
1211- # Calculate the different components
1212- diffuse_components ['poa_isotropic' ] = dhi * term1
1213- diffuse_components ['poa_circumsolar' ] = dhi * term2
1214- diffuse_components ['poa_horizon' ] = dhi * term3
1203+ diffuse_components = {
1204+ 'poa_sky_diffuse' : sky_diffuse ,
1205+ 'poa_isotropic' : dhi * term1 ,
1206+ 'poa_circumsolar' : dhi * term2 ,
1207+ 'poa_horizon' : dhi * term3
1208+ }
12151209
12161210 # Set values of components to 0 when sky_diffuse is 0
12171211 mask = sky_diffuse == 0
@@ -1351,7 +1345,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
13511345
13521346 Returns
13531347 --------
1354- numeric, OrderedDict , or DataFrame
1348+ numeric, dict , or DataFrame
13551349 Return type controlled by `return_components` argument.
13561350 If ``return_components=False``, `sky_diffuse` is returned.
13571351 If ``return_components=True``, `diffuse_components` is returned.
@@ -1360,7 +1354,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
13601354 The sky diffuse component of the solar radiation on a tilted
13611355 surface.
13621356
1363- diffuse_components : OrderedDict (array input) or DataFrame (Series input)
1357+ diffuse_components : dict (array input) or DataFrame (Series input)
13641358 Keys/columns are:
13651359 * poa_sky_diffuse: Total sky diffuse
13661360 * poa_isotropic
@@ -1425,13 +1419,12 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
14251419 sky_diffuse = np .maximum (dhi * (term1 + term2 + term3 ), 0 )
14261420
14271421 if return_components :
1428- diffuse_components = OrderedDict ()
1429- diffuse_components ['poa_sky_diffuse' ] = sky_diffuse
1430-
1431- # Calculate the different components
1432- diffuse_components ['poa_isotropic' ] = dhi * term1
1433- diffuse_components ['poa_circumsolar' ] = dhi * term2
1434- diffuse_components ['poa_horizon' ] = dhi * term3
1422+ diffuse_components = {
1423+ 'poa_sky_diffuse' : sky_diffuse ,
1424+ 'poa_isotropic' : dhi * term1 ,
1425+ 'poa_circumsolar' : dhi * term2 ,
1426+ 'poa_horizon' : dhi * term3
1427+ }
14351428
14361429 if isinstance (sky_diffuse , pd .Series ):
14371430 diffuse_components = pd .DataFrame (diffuse_components )
0 commit comments