Skip to content

Commit

Permalink
change pvlib v0.11 column names for read_tmy3
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeline committed Aug 23, 2024
1 parent a75b26f commit 83e9544
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bifacial_radiance/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ def _convertTMYdate(data, meta):
try:
(tmydata, metadata) = pvlib.iotools.tmy.read_tmy3(filename=tmyfile,
coerce_year=coerce_year,
map_variables=False)
map_variables=True)
except TypeError: # pvlib < 0.10
(tmydata, metadata) = pvlib.iotools.tmy.read_tmy3(filename=tmyfile,
coerce_year=coerce_year)
Expand All @@ -1187,7 +1187,14 @@ def _convertTMYdate(data, meta):
tmydata = _convertTMYdate(tmydata, metadata)
except KeyError:
print('PVLib >= 0.8.0 is required for sub-hourly data input')


tmydata.rename(columns={'dni':'DNI',
'dhi':'DHI',
'temp_air':'DryBulb',
'wind_speed':'Wspd',
'ghi':'GHI',
'albedo':'Alb'
}, inplace=True) #as of v0.11, PVLib changed tmy3 column names..

return tmydata, metadata

Expand Down

0 comments on commit 83e9544

Please sign in to comment.