Private
Public Access
1
0

fixing zero division

This commit is contained in:
2023-08-17 07:40:34 +02:00
parent b8eb4f45c0
commit 73089b8c67
2 changed files with 5 additions and 1 deletions

View File

@@ -1636,7 +1636,11 @@ def workout_trimp(w, reset=False):
return w.trimp, 0
elif w.trimp <= 0 and w.averagehr > 0:
if get_existing_job(w):
return 0, 100.*(w.averagehr/r.hrftp)*(w.duration.hour*60 + w.duration.minute)/60.
try:
return 0, 100.*(w.averagehr/r.hrftp)*(w.duration.hour*60 + w.duration.minute)/60.
except ZeroDivisionError:
return 0, 0
ftp = float(r.ftp)
_ = myqueue(
queuehigh,

Binary file not shown.