Skip to content

Commit

Permalink
Merge pull request #59 from duncanmmacleod/find-frames-empty
Browse files Browse the repository at this point in the history
Fixed IndexError for no frames in data.find_frames
  • Loading branch information
Duncan Macleod authored Mar 8, 2018
2 parents fdda71c + 118a2aa commit 989f812
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions omicron/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,14 @@ def find_frames(obs, frametype, start, end, connection=None, **kwargs):
# use latest frame to find more recent frames that aren't in
# datafind yet, this is quite hacky, and isn't guaranteed to
# work at any point, but it shouldn't break anything
latest = cache[-1]
try:
latest = cache[-1]
except IndexError: # no frames
return cache
try:
ngps = len(re_gwf_gps_epoch.search(
os.path.dirname(latest.path)).groupdict()['gpsepoch'])
except AttributeError:
except AttributeError: # no match
pass
else:
while True:
Expand Down

0 comments on commit 989f812

Please sign in to comment.