lmdk_bgt.discount: Dealing with zero
This commit is contained in:
parent
96a1178c09
commit
b1b4a11d39
@ -442,8 +442,11 @@ def discount(seq, lmdks, epsilon):
|
|||||||
lmdk_cur = 0
|
lmdk_cur = 0
|
||||||
# Track skipped releases
|
# Track skipped releases
|
||||||
skipped = 0
|
skipped = 0
|
||||||
|
# Initialize the sampling rate
|
||||||
|
samp_rt = .5
|
||||||
for i, p in enumerate(seq):
|
for i, p in enumerate(seq):
|
||||||
# The sampling rate
|
# Adjust the sampling rate
|
||||||
|
if 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):
|
||||||
|
Loading…
Reference in New Issue
Block a user