Closed
Description
Describe the bug
For some reason related to timezone handling, the solarposition.hour_angle
function fails on pandas versions 0.15-0.18. We test 0.14 and latest. Apparently we were on pandas 0.19 or greater when this function was created.
Also, the loop over datetime values is probably slow.
hours = np.array([(t - t.tz.localize(
dt.datetime(t.year, t.month, t.day)
)).total_seconds() / 3600. for t in times])
I think this gives the same result:
hours = (times.astype(int) - times.normalize().astype(int)) / 1e9 / 3600
Versions:
pvlib.__version__
: 0.6.0pandas.__version__
:- python:
Additional context
probably should address #597 first