You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Location.get_clearsky, irradiance.extraradiation, and solarposition.ephemeris failures in pandas 0.20 #325
The DatetimeIndex attribute behavior changed in 0.20, and this leads to problems in the Location.get_clearskydni_extra calculation and thus the clearsky calculation.
In [2]: times=pd.date_range(start='20140624', freq='6H', periods=4, tz='US/Arizona')
In [3]: times.dayofyearOut[3]: array([175, 175, 175, 175], dtype=int32)
In [5]: pvlib.irradiance.extraradiation(times.dayofyear)
Out[5]: array([ 1321.16558348, 1321.16558348, 1321.16558348, 1321.16558348])
pandas 0.20.1
In [2]: times=pd.date_range(start='20140624', freq='6H', periods=4, tz='US/Arizona')
In [3]: times.dayofyearOut[3]: Int64Index([175, 175, 175, 175], dtype='int64')
In [5]: pvlib.irradiance.extraradiation(times.dayofyear)
Out[5]: Float64Index([1321.16558348, 1321.16558348, 1321.16558348, 1321.16558348], dtype='float64')
Simply passing times (no .dayofyear) will return a Series, and everything works again. I don't know why I chose to use times.dayofyear instead of just times when building this method. Maybe irradiance.extraradiation didn't accept Series back then?
Next, the solarposition.ephemeris function contains
Activity