Skip to content

Error in clearsky.reno in newer pandas and numpy versions #126

@kandersolar

Description

@kandersolar

I know there are some known pandas issues already, but I think this one is new? This snippet raises an error for some combinations of pandas and numpy:

from pvanalytics.features.clearsky import reno
import pandas as pd

times = pd.date_range('2019-01-01 12:00', freq='1min', periods=3)
ghi = pd.Series([1,1,1], index=times)
reno(ghi, ghi)  # ValueError: clearsky requires regular time intervals of 15m or less

It fails with numpy==1.21.4 + pandas==1.3.0. It works with numpy==1.19.5 + pandas==1.2.5.

This is the issue:

In [7]: pd.Timedelta("1T") / np.timedelta64(1, "60s")
Out[7]: 60.0  # returns 1.0 on older versions

I did not do any digging for changes in either library that may have caused this, or whether the issue can be isolated to a change in just one of pandas or numpy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions