Private
Public Access
1
0

hotfix hrftp

This commit is contained in:
Sander Roosendaal
2018-04-09 18:27:25 +02:00
parent b084b65ad5
commit 7edefc2373
3 changed files with 13 additions and 6 deletions

View File

@@ -2307,7 +2307,7 @@ def workout_trimp(workout):
r = workout.user
if r.hrftp == 0:
hrftp = (r.an+r.tr)/2.
r.hrftp = hrftp
r.hrftp = int(hrftp)
r.save()
df,row = getrowdata_db(id=workout.id)
@@ -2316,8 +2316,14 @@ def workout_trimp(workout):
df,row = getrowdata_db(id=workout.id)
df = clean_df_stats(df,workstrokesonly=False)
trimp,hrtss = calc_trimp(df,r.sex,r.max,r.rest,r.hrftp)
trimp = int(trimp)
hrtss = int(hrtss)
if not np.isnan(trimp):
trimp = int(trimp)
else:
trimp = 0
if not np.isnan(hrtss):
hrtss = int(hrtss)
else:
hrtss = 0
return trimp,hrtss