Skip to content

Commit

Permalink
Cope better when very little logged data
Browse files Browse the repository at this point in the history
If you leap straight into processing with a new station there might not
be enough data to generate a monthly or daily file.

Signed-off-by: Jim Easterbrook <jim@jim-easterbrook.me.uk>
  • Loading branch information
jim-easterbrook committed Aug 23, 2018
1 parent 40be4b4 commit a49f727
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pywws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '18.8.0'
_release = '1586'
_commit = 'd2d51a1'
_release = '1587'
_commit = '40be4b4'
2 changes: 2 additions & 0 deletions src/pywws/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,8 @@ def generate_monthly(rain_day_threshold, day_end_hour, use_dst,
start -= DAY
del monthly_data[start:]
stop = daily_data.before(datetime.max)
if stop is None:
return None
month_start = start
acc = MonthAcc(rain_day_threshold)
count = 0
Expand Down

0 comments on commit a49f727

Please sign in to comment.