From 48150d166b6e056fbaeecc829926e9001f764e7c Mon Sep 17 00:00:00 2001 From: Evan Goetz <32753745+eagoetz@users.noreply.github.com> Date: Tue, 7 Mar 2023 10:49:20 -0800 Subject: [PATCH] Bugfix for when hours are requested in a state (#362) Currently the "hours" option in a state is broken because the value for the day start is not being saved in the code. Basically the replace() method for a datetime object does not change the value in-place, it just returns the value. So essentially, all the broken code was doing was stating the day start but not actually using it. This fixes the problem Co-authored-by: Evan Goetz --- gwsumm/state/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gwsumm/state/core.py b/gwsumm/state/core.py index 292d4913..f5c64310 100644 --- a/gwsumm/state/core.py +++ b/gwsumm/state/core.py @@ -323,7 +323,7 @@ def fetch(self, config=GWSummConfigParser(), segs_ = SegmentList() # get start day d = Time(float(self.start), format='gps', scale='utc').datetime - d.replace(hour=0, minute=0, second=0, microsecond=0) + d = d.replace(hour=0, minute=0, second=0, microsecond=0) end_ = Time(float(self.end), format='gps', scale='utc').datetime while d < end_: # get GPS of day