Skip to content

test_forecast failures with pandas 1.0.0 #877

Closed

Description

@cwhanse

Pandas has released v1.0.0. With pandas 1.0.0, test_forecast.test_datetime fails, as #872 shows in the test log. It is not clear if the test itself is the problem: these lines do not set a timezone.

    start = datetime.now()
    end = start + timedelta(days=1)

Should start and end be timezone-aware? The intent of the test is not clear to me.

To Reproduce
Steps to reproduce the behavior:

  1. Install pandas 1.0.0
import pandas as pd
from datetime import datetime, timedelta
from pvlib.forecast import NAM

_latitude = 32.2
_longitude = -110.9
_tz = 'US/Arizona'
_start = pd.Timestamp.now(tz=_tz)
_end = _start + pd.Timedelta(days=1)

amodel = NAM()
start = datetime.now()
end = start + timedelta(days=1)
try:
    amodel.get_processed_data(_latitude, _longitude, start, end)
    print("Success with {}".format(pd.__version__))
except:
    print("Failed with {}".format(pd.__version__))

Now run with pandas < 1.0.0 (e.g., 0.22.0)

Activity

  1. wholmgren commented on Feb 3, 2020

    @wholmgren
    Member

    The test ensures that the function works if you use a python datetime object instead of pandas datetime object. We should check that start/end are localized and, if not, raise TypeError before issuing the query.

  2. cwhanse commented on Feb 3, 2020

    @cwhanse
    MemberAuthor

    Want to correct this in conjunction with #878? Or I can do it. The test failures will repeat for every PR unless we pin pandas <= 1.0.0.

  3. wholmgren commented on Feb 3, 2020

    @wholmgren
    Member

    Yes, I should have said I'll provide a fix as soon as I get out of conda hell. Apparently I should not have run pip install pandas -U in an environment with conda-provided numpy/netcdf/hdf5. Yay python packaging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions