diff --git a/docs/sphinx/source/whatsnew/v0.7.2.rst b/docs/sphinx/source/whatsnew/v0.7.2.rst index d57a2062cd..7df2550d9d 100644 --- a/docs/sphinx/source/whatsnew/v0.7.2.rst +++ b/docs/sphinx/source/whatsnew/v0.7.2.rst @@ -29,6 +29,7 @@ Bug fixes `0.7.0 what's new `_ entries about changes to ``PVSystem.pvwatts_ac``. Delete unreleased 0.6.4 what's new file. (:issue:`898`) +* Compatibility with cftime 1.1. (:issue:`895`) Documentation ~~~~~~~~~~~~~ diff --git a/pvlib/forecast.py b/pvlib/forecast.py index 9533b9535b..e760b18c10 100644 --- a/pvlib/forecast.py +++ b/pvlib/forecast.py @@ -2,7 +2,6 @@ The 'forecast' module contains class definitions for retreiving forecasted data from UNIDATA Thredd servers. ''' -import datetime from netCDF4 import num2date import numpy as np import pandas as pd @@ -406,7 +405,8 @@ def set_time(self, time): ------- pandas.DatetimeIndex ''' - times = num2date(time[:].squeeze(), time.units) + times = num2date(time[:].squeeze(), time.units, + only_use_cftime_datetimes=False) self.time = pd.DatetimeIndex(pd.Series(times), tz=self.location.tz) def cloud_cover_to_ghi_linear(self, cloud_cover, ghi_clear, offset=35,