Skip to content

Commit

Permalink
Avoid querying future data (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
clampr committed Sep 26, 2023
1 parent d6cb88b commit e3a927e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions meteostat/interface/hourly.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,7 @@ def _set_time(
end = timezone.localize(end, is_dst=None).astimezone(pytz.utc)

if self.chunked:
self._annual_steps = list(
set(
[
(start + timedelta(days=365 * i)).year
for i in range(end.year - start.year + 2)
]
)
)
self._annual_steps = [start.year + i for i in range(end.year - start.year + 1)]

self._start = start
self._end = end
Expand Down

0 comments on commit e3a927e

Please sign in to comment.