Merge tag 'v6.41' into develop
hotfix hrftp
This commit is contained in:
@@ -2307,7 +2307,7 @@ def workout_trimp(workout):
|
|||||||
r = workout.user
|
r = workout.user
|
||||||
if r.hrftp == 0:
|
if r.hrftp == 0:
|
||||||
hrftp = (r.an+r.tr)/2.
|
hrftp = (r.an+r.tr)/2.
|
||||||
r.hrftp = hrftp
|
r.hrftp = int(hrftp)
|
||||||
r.save()
|
r.save()
|
||||||
|
|
||||||
df,row = getrowdata_db(id=workout.id)
|
df,row = getrowdata_db(id=workout.id)
|
||||||
@@ -2316,8 +2316,14 @@ def workout_trimp(workout):
|
|||||||
df,row = getrowdata_db(id=workout.id)
|
df,row = getrowdata_db(id=workout.id)
|
||||||
df = clean_df_stats(df,workstrokesonly=False)
|
df = clean_df_stats(df,workstrokesonly=False)
|
||||||
trimp,hrtss = calc_trimp(df,r.sex,r.max,r.rest,r.hrftp)
|
trimp,hrtss = calc_trimp(df,r.sex,r.max,r.rest,r.hrftp)
|
||||||
trimp = int(trimp)
|
if not np.isnan(trimp):
|
||||||
hrtss = int(hrtss)
|
trimp = int(trimp)
|
||||||
|
else:
|
||||||
|
trimp = 0
|
||||||
|
if not np.isnan(hrtss):
|
||||||
|
hrtss = int(hrtss)
|
||||||
|
else:
|
||||||
|
hrtss = 0
|
||||||
|
|
||||||
return trimp,hrtss
|
return trimp,hrtss
|
||||||
|
|
||||||
|
|||||||
@@ -352,8 +352,9 @@ def calc_trimp(df,sex,hrmax,hrmin,hrftp):
|
|||||||
dt = df['time'].diff()/6.e4
|
dt = df['time'].diff()/6.e4
|
||||||
|
|
||||||
hrr = (df['hr']-hrmin)/(hrmax-hrmin)
|
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)
|
trimp1hr = 60*hrrftp*0.64*np.exp(f*hrrftp)
|
||||||
|
|
||||||
trimpdata = dt*hrr*0.64*np.exp(f*hrr)
|
trimpdata = dt*hrr*0.64*np.exp(f*hrr)
|
||||||
trimp = trimpdata.sum()
|
trimp = trimpdata.sum()
|
||||||
|
|
||||||
|
|||||||
@@ -131,10 +131,10 @@ def is_manager(user):
|
|||||||
r = Rower.objects.get(user=user)
|
r = Rower.objects.get(user=user)
|
||||||
return r.rowerplan == 'coach'
|
return r.rowerplan == 'coach'
|
||||||
|
|
||||||
|
from rowers.views import hasplannedsessions
|
||||||
@register.filter
|
@register.filter
|
||||||
def is_planmember(user):
|
def is_planmember(user):
|
||||||
r = Rower.objects.get(user=user)
|
return hasplannedsessions(user)
|
||||||
return r.rowerplan == 'plan' or r.rowerplan == 'coach'
|
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def user_teams(user):
|
def user_teams(user):
|
||||||
|
|||||||
Reference in New Issue
Block a user