Skip to content

Commit

Permalink
flux: Fail to cue at index when there's insufficient data
Browse files Browse the repository at this point in the history
When there isn't a contiguous index-aligned revolution of data,
we end up with a flux object with no index marks. This is often
useless and can crash elsewhere in the tools.
  • Loading branch information
keirf committed Jul 6, 2024
1 parent 4d5a8c8 commit b0012e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/greaseweazle/flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ def cue_at_index(self) -> None:
if self.index_cued:
return

error.check(len(self.index_list) >= 2,
'''\
Not enough revolutions of flux data to cue at index.
Try dumping more revolutions (larger --revs value).''')

# Clip the initial partial revolution.
to_index = self.index_list[0]
for i in range(len(self.list)):
Expand Down

0 comments on commit b0012e6

Please sign in to comment.