lmdk_bgt: Dealing with zero correctly

This commit is contained in:
Manos Katsomallos 2021-07-26 18:13:54 +03:00
parent 912c9d441e
commit 8db5adaf48

View File

@ -446,7 +446,7 @@ def discount(seq, lmdks, epsilon):
samp_rt = .5 samp_rt = .5
for i, p in enumerate(seq): for i, p in enumerate(seq):
# Adjust the sampling rate # Adjust the sampling rate
if lmdks: if len(lmdks):
samp_rt = datetime.fromtimestamp(int(lmdks[lmdk_cur][3]))/datetime.fromtimestamp(int(lmdks[len(lmdks) - 1][3])) samp_rt = datetime.fromtimestamp(int(lmdks[lmdk_cur][3]))/datetime.fromtimestamp(int(lmdks[len(lmdks) - 1][3]))
# Check if current point is a landmark # Check if current point is a landmark
if lmdk_lib.is_landmark(p, lmdks): if lmdk_lib.is_landmark(p, lmdks):