Skip to content

Commit

Permalink
Minor comment update and fix percentage of no detector when not runni…
Browse files Browse the repository at this point in the history
…ng future data
  • Loading branch information
Evan Goetz committed Jan 25, 2024
1 parent 0c3d6d7 commit e8b796e
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions gwsumm/plot/segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,16 @@ def draw(self, outputfile=None):
wedgeargs = self.parse_wedge_kwargs()
plotargs = self.parse_plot_kwargs()

# Are we currently running before, during, or after?
# Boolean logic flags to determine if this code is currently running:
# - before the span of interest (current time the code is running <
# start of span)
# - after the span of interest (current time the code is running >= end
# of span)
# - during the span of interest (any other time)
# The flag is set to True for the appropriate noun (before, during, or
# after).
# These flags are then used to set plot titles and labels and determine
# if there is any missing data.
before = during = after = False
if globalv.NOW < int(self.span[0]):
before = True
Expand All @@ -1024,17 +1033,17 @@ def draw(self, outputfile=None):
if future or after:
self.pargs.setdefault(

Check warning on line 1034 in gwsumm/plot/segments.py

View check run for this annotation

Codecov / codecov/patch

gwsumm/plot/segments.py#L1033-L1034

Added lines #L1033 - L1034 were not covered by tests
'suptitle',
(f'[{self.span[0]}-{self.span[1]}, ',
(f'[{self.span[0]}-{self.span[1]}, '
f'state: {texify(str(self.state))}]'))
elif before:
self.pargs.setdefault(

Check warning on line 1039 in gwsumm/plot/segments.py

View check run for this annotation

Codecov / codecov/patch

gwsumm/plot/segments.py#L1038-L1039

Added lines #L1038 - L1039 were not covered by tests
'suptitle',
(f'[{self.span[0]}-{self.span[0]}, ',
(f'[{self.span[0]}-{self.span[0]}, '
f'state: {texify(str(self.state))}]'))
else:
self.pargs.setdefault(

Check warning on line 1044 in gwsumm/plot/segments.py

View check run for this annotation

Codecov / codecov/patch

gwsumm/plot/segments.py#L1044

Added line #L1044 was not covered by tests
'suptitle',
(f'[{self.span[0]}-{globalv.NOW}, ',
(f'[{self.span[0]}-{globalv.NOW}, '
f'state: {texify(str(self.state))}]'))
else:
if future or after:
Expand Down Expand Up @@ -1236,6 +1245,14 @@ def draw(self):
compound, validity=valid, query=False,
padding=self.padding, ignore_undefined=True).coalesce()
networksegs += segs
# Final step in the loop for no detectors: if not wanting to plot
# future times, then exclude the time from now to the end of the
# span from the no detector network
if (i == 0 and

Check warning on line 1251 in gwsumm/plot/segments.py

View check run for this annotation

Codecov / codecov/patch

gwsumm/plot/segments.py#L1251

Added line #L1251 was not covered by tests
not self.pargs.get('include_future', False) and
globalv.NOW < self.span[1]):
exclude.active += SegmentList(

Check warning on line 1254 in gwsumm/plot/segments.py

View check run for this annotation

Codecov / codecov/patch

gwsumm/plot/segments.py#L1254

Added line #L1254 was not covered by tests
[Segment(globalv.NOW, self.span[1])])
# insert this flag into the segments global variable and exclude
# any of the previous network (more detectors) time from this time
globalv.SEGMENTS[flag] = networksegs.copy()
Expand Down

0 comments on commit e8b796e

Please sign in to comment.