Private
Public Access
1
0

Merge tag 'v6.41' into develop

hotfix hrftp
This commit is contained in:
Sander Roosendaal
2018-04-09 18:28:50 +02:00
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

View File

@@ -352,8 +352,9 @@ def calc_trimp(df,sex,hrmax,hrmin,hrftp):
dt = df['time'].diff()/6.e4
hrr = (df['hr']-hrmin)/(hrmax-hrmin)
hrrftp = (hrftp-hrmin)/(hrmax-hrmin)
hrrftp = (hrftp-hrmin)/float(hrmax-hrmin)
trimp1hr = 60*hrrftp*0.64*np.exp(f*hrrftp)
trimpdata = dt*hrr*0.64*np.exp(f*hrr)
trimp = trimpdata.sum()

View File

@@ -131,10 +131,10 @@ def is_manager(user):
r = Rower.objects.get(user=user)
return r.rowerplan == 'coach'
from rowers.views import hasplannedsessions
@register.filter
def is_planmember(user):
r = Rower.objects.get(user=user)
return r.rowerplan == 'plan' or r.rowerplan == 'coach'
return hasplannedsessions(user)
@register.filter
def user_teams(user):