Private
Public Access
1
0

central rscore approx

This commit is contained in:
2023-08-22 16:50:53 +02:00
parent 107983ab34
commit 02d1dc273e
4 changed files with 35 additions and 34 deletions

View File

@@ -1507,21 +1507,8 @@ def weightfromrecord(row,metricchoice):
vv = row[metricchoice]
if vv > 0:
return vv
if vv == 0:
if metricchoice == 'rscore' and row['hrtss'] > 0: # pragma: no cover
return row['hrtss']
else:
dd = 3600*row['duration'].hour+60*row['duration'].minute+row['duration'].second
dd = dd/3600
return rpetotss[row['rpe']]*dd
if vv < 0:
w = Workout.objects.get(id=row['id'])
trimp, hrtss = dataprep.workout_trimp(w)
rscore, normp = dataprep.workout_rscore(w)
if row['rpe'] and row['rpe'] > 0: # pragma: no cover
dd = 3600*row['duration'].hour+60*row['duration'].minute+row['duration'].second
dd = dd/3600
return rpetotss[row['rpe']]*dd
if metricchoice == 'rscore':
return rscore_approx(row)
return 0