Skip to content

Commit

Permalink
Fixes #439. custom weatherfile with non-leading zero timestamp data.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeline committed Sep 30, 2024
1 parent 317462b commit facf604
Show file tree
Hide file tree
Showing 4 changed files with 25,326 additions and 25,319 deletions.
19 changes: 12 additions & 7 deletions bifacial_radiance/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,15 +1368,20 @@ def _convertTMYdate(data, meta):


import pvlib
import packaging.version as version
#(tmydata, metadata) = pvlib.tmy.readtmy3(filename=tmyfile) #pvlib<=0.6
try:
(tmydata, metadata) = pvlib.iotools.tmy.read_tmy3(filename=tmyfile,
coerce_year=coerce_year,
map_variables=True)
except TypeError: # pvlib < 0.10
(tmydata, metadata) = pvlib.iotools.tmy.read_tmy3(filename=tmyfile,
coerce_year=coerce_year)

try:
if version.Version(pvlib.__version__) >= version.Version('0.10'):
(tmydata, metadata) = pvlib.iotools.tmy.read_tmy3(filename=tmyfile,
coerce_year=coerce_year,
map_variables=True)
else: # pvlib < 0.10
(tmydata, metadata) = pvlib.iotools.tmy.read_tmy3(filename=tmyfile,
coerce_year=coerce_year)
except Exception as E:

raise Exception('Error in pvlib.read_tmy3:', E)
try:
tmydata = _convertTMYdate(tmydata, metadata)
except KeyError:
Expand Down
Loading

0 comments on commit facf604

Please sign in to comment.