Private
Public Access
1
0

Merge branch 'feature/fitnesschart' into develop

This commit is contained in:
Sander Roosendaal
2021-01-03 19:05:32 +01:00
7 changed files with 225 additions and 48 deletions

View File

@@ -1585,15 +1585,21 @@ def performancemanager_view(request,userid=0,mode='rower',
'dofatigue':dofatigue,
})
script, thediv, endfitness, endfatigue, endform = performance_chart(
script, thediv, endfitness, endfatigue, endform, ids = performance_chart(
theuser,startdate=startdate,enddate=enddate,
kfitness = kfitness,
kfatigue = kfatigue,
metricchoice = metricchoice,
doform = doform,
dofatigue = dofatigue,
showtests = True,
)
ids = pd.Series(ids).dropna().values
bestworkouts = Workout.objects.filter(id__in=ids).order_by('date')
breadcrumbs = [
{
'url':'/rowers/analysis',
@@ -1629,6 +1635,7 @@ def performancemanager_view(request,userid=0,mode='rower',
'endfitness':int(endfitness),
'endfatigue':int(endfatigue),
'endform':int(endform),
'bestworkouts':bestworkouts,
})
@@ -1678,12 +1685,8 @@ def fitness_from_cp_view(request,userid=0,mode='rower',
workouts = Workout.objects.filter(user=therower,date__gte=startdate,
date__lte=enddate,
workouttype__in=mytypes.otwtypes,
workouttype__in=mytypes.rowtypes,
duplicate=False)
if mode == 'rower':
workouts = Workout.objects.filter(user=therower,date__gte=startdate,
date__lte=enddate,workouttype__in=mytypes.otetypes,
duplicate=False)

View File

@@ -3502,19 +3502,19 @@ def workout_stats_view(request,id=0,message="",successmessage=""):
goldmedalstandard,goldmedalseconds = dataprep.workout_goldmedalstandard(w)
#if not np.isnan(goldmedalstandard) and goldmedalstandard > 0:
# otherstats['goldmedalstandard'] = {
# 'verbose_name': 'Gold Medal Standard',
# 'value': int(goldmedalstandard),
# 'unit': '%',
# }
if not np.isnan(goldmedalstandard) and goldmedalstandard > 0:
otherstats['goldmedalstandard'] = {
'verbose_name': 'Gold Medal Standard',
'value': int(goldmedalstandard),
'unit': '%',
}
#if not np.isnan(goldmedalseconds) and goldmedalseconds > 0:
# otherstats['goldmedalseconds'] = {
# 'verbose_name': 'Gold Medal Standard Duration',
# 'value': utils.totaltime_sec_to_string(goldmedalseconds,shorten=True),
# 'unit': '',
# }
if not np.isnan(goldmedalseconds) and goldmedalseconds > 0:
otherstats['goldmedalseconds'] = {
'verbose_name': 'Gold Medal Standard Duration',
'value': utils.totaltime_sec_to_string(goldmedalseconds,shorten=True),
'unit': '',
}
if not np.isnan(tss) and tss != 0: