Skip to content

Commit 5ce3601

Browse files
committed
Change OrderedDict to Dict in perez and perez_driesse
1 parent 1703cef commit 5ce3601

1 file changed

Lines changed: 16 additions & 18 deletions

File tree

pvlib/irradiance.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
11061106
11071107
Returns
11081108
--------
1109-
numeric, OrderedDict, or DataFrame
1109+
numeric, Dict, or DataFrame
11101110
Return type controlled by `return_components` argument.
11111111
If ``return_components=False``, `sky_diffuse` is returned.
11121112
If ``return_components=True``, `diffuse_components` is returned.
@@ -1115,7 +1115,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
11151115
The sky diffuse component of the solar radiation on a tilted
11161116
surface.
11171117
1118-
diffuse_components : OrderedDict (array input) or DataFrame (Series input)
1118+
diffuse_components : Dict (array input) or DataFrame (Series input)
11191119
Keys/columns are:
11201120
* poa_sky_diffuse: Total sky diffuse
11211121
* poa_isotropic
@@ -1202,13 +1202,12 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
12021202
sky_diffuse = np.where(np.isnan(airmass), 0, sky_diffuse)
12031203

12041204
if return_components:
1205-
diffuse_components = OrderedDict()
1206-
diffuse_components['poa_sky_diffuse'] = sky_diffuse
1207-
1208-
# Calculate the different components
1209-
diffuse_components['poa_isotropic'] = dhi * term1
1210-
diffuse_components['poa_circumsolar'] = dhi * term2
1211-
diffuse_components['poa_horizon'] = dhi * term3
1205+
diffuse_components = {
1206+
'poa_sky_diffuse': sky_diffuse,
1207+
'poa_isotropic': dhi * term1,
1208+
'poa_circumsolar': dhi * term2,
1209+
'poa_horizon': dhi * term3
1210+
}
12121211

12131212
# Set values of components to 0 when sky_diffuse is 0
12141213
mask = sky_diffuse == 0
@@ -1348,7 +1347,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
13481347
13491348
Returns
13501349
--------
1351-
numeric, OrderedDict, or DataFrame
1350+
numeric, Dict, or DataFrame
13521351
Return type controlled by `return_components` argument.
13531352
If ``return_components=False``, `sky_diffuse` is returned.
13541353
If ``return_components=True``, `diffuse_components` is returned.
@@ -1357,7 +1356,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
13571356
The sky diffuse component of the solar radiation on a tilted
13581357
surface.
13591358
1360-
diffuse_components : OrderedDict (array input) or DataFrame (Series input)
1359+
diffuse_components : Dict (array input) or DataFrame (Series input)
13611360
Keys/columns are:
13621361
* poa_sky_diffuse: Total sky diffuse
13631362
* poa_isotropic
@@ -1422,13 +1421,12 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
14221421
sky_diffuse = np.maximum(dhi * (term1 + term2 + term3), 0)
14231422

14241423
if return_components:
1425-
diffuse_components = OrderedDict()
1426-
diffuse_components['poa_sky_diffuse'] = sky_diffuse
1427-
1428-
# Calculate the different components
1429-
diffuse_components['poa_isotropic'] = dhi * term1
1430-
diffuse_components['poa_circumsolar'] = dhi * term2
1431-
diffuse_components['poa_horizon'] = dhi * term3
1424+
diffuse_components = {
1425+
'poa_sky_diffuse': sky_diffuse,
1426+
'poa_isotropic': dhi * term1,
1427+
'poa_circumsolar': dhi * term2,
1428+
'poa_horizon': dhi * term3
1429+
}
14321430

14331431
if isinstance(sky_diffuse, pd.Series):
14341432
diffuse_components = pd.DataFrame(diffuse_components)

0 commit comments

Comments
 (0)