Skip to content

Commit

Permalink
Bugfix for when hours are requested in a state (gwpy#362)
Browse files Browse the repository at this point in the history
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 <evan.goetz@ligo.org>
  • Loading branch information
eagoetz and Evan Goetz authored Mar 7, 2023
1 parent 8b0ce61 commit 48150d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gwsumm/state/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48150d1

Please sign in to comment.