Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions docs/sphinx/source/whatsnew/v0.9.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Enhancements
for retrieving and reading BSRN solar radiation data files.
(:pull:`1254`, :pull:`1145`, :issue:`1015`)
* Add :func:`~pvlib.iotools.get_cams`,
:func:`~pvlib.iotools.parse_cams`, and
:func:`~pvlib.iotools.parse_cams`, and
:func:`~pvlib.iotools.read_cams`
for retrieving, parsing, and reading CAMS Radiation and McClear time-series
files. (:pull:`1175`)
Expand Down Expand Up @@ -179,9 +179,9 @@ Enhancements
Bug fixes
~~~~~~~~~
* Corrected an error in :py:func:`~pvlib.irradiance.perez` where the horizon
irradiance component was prevented from taking negative values. Negative
values are intentional according to the original publication. Changes in
output are expected to be small and primarily occur at low irradiance
irradiance component was prevented from taking negative values. Negative
values are intentional according to the original publication. Changes in
output are expected to be small and primarily occur at low irradiance
conditions.
(:issue:`1238`, :pull:`1239`)
* Pass weather data to solar position calculations in
Expand All @@ -205,7 +205,9 @@ Bug fixes
* Changed deprecated use of ``.astype()`` to ``.view()`` in :py:mod:`~pvlib.solarposition`.
(:pull:`1256`, :issue:`1261`, :pull:`1262`)
* Fix :py:func:`~pvlib.tracking.singleaxis` AOI wrong when sun behind module.
(:pull:`1273`, :issue:`1221`)
(:pull:`1273`, :issue:`1221`)
* Fix :py:meth:`~pvlib.forecast.ForecastModel.get_data` failure to correct for
non-UTC timezones. (:issue:`1237`, :pull:`1285`)

Testing
~~~~~~~
Expand Down
13 changes: 11 additions & 2 deletions pvlib/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ def set_query_time_range(self, start, end):
self.end = pd.Timestamp(end)
if self.start.tz is None or self.end.tz is None:
raise TypeError('start and end must be tz-localized')
self.query.time_range(self.start, self.end)
# don't assume that siphon or the server can handle anything other
# than UTC
self.query.time_range(
self.start.tz_convert('UTC'),
self.end.tz_convert('UTC')
)

def set_query_latlon(self):
'''
Expand Down Expand Up @@ -412,10 +417,14 @@ def set_time(self, time):
-------
pandas.DatetimeIndex
'''
# np.masked_array with elements like real_datetime(2021, 8, 17, 16, 0)
# and dtype=object
times = num2date(time[:].squeeze(), time.units,
only_use_cftime_datetimes=False,
only_use_python_datetimes=True)
self.time = pd.DatetimeIndex(pd.Series(times), tz=self.location.tz)
# convert to pandas, localize to UTC, convert to desired timezone
self.time = pd.DatetimeIndex(
times, tz='UTC').tz_convert(self.location.tz)

def cloud_cover_to_ghi_linear(self, cloud_cover, ghi_clear, offset=35,
**kwargs):
Expand Down