Found a bug in utilities.py

38 views
Skip to first unread message

Mike Revitt

unread,
Feb 10, 2021, 10:30:23 AM2/10/21
to weewx-development
Whilst trying to create some long term graphs I discovered a bug in utilities.py at line 297

    elif tdelta < 2 * 365.25 * 24 * 3600 :

        # The time scale is between a month and 2 years. A time increment of a month is appropriate

        start_dt = tmin_dt.replace(day=1, hour=0, minute=0, second=0, microsecond=0)

Should read

    elif tdelta <= 2 * 365.25 * 24 * 3600 :

        # The time scale is between a month and 2 years. A time increment of a month is appropriate

        start_dt = tmin_dt.replace(day=1, hour=0, minute=0, second=0, microsecond=0)

Otherwise it doesn't trap values of exactly 2 years. it is <= everywhere else

Tom Keffer

unread,
Feb 10, 2021, 10:36:39 AM2/10/21
to Mike Revitt, weewx-development
Commit 1f7790

Thanks, Mike!

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/f4bbe42b-44a7-48c5-960a-8ed7e73bd2c5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages