Skip to content

Commit

Permalink
Fix: Assertion when no event minute data is available (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
LarchLiu authored Sep 26, 2023
1 parent 029afc2 commit b138644
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tfmkt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def background_position_in_px_to_minute(px_x: int, px_y: int) -> int:
for a in range(1, m)
]

if abs(px_y) > h*(m - 1 - y_offset): # no data available
return -1

x = abs(px_x) / h
assert x.is_integer()
x = int(x) + x_offset
Expand Down

0 comments on commit b138644

Please sign in to comment.