improvements to perf manager chart and making sure tss and trimp are calculated always
This commit is contained in:
@@ -23,7 +23,7 @@ from bokeh.palettes import Set1_4 as palette2
|
||||
from bokeh.models.glyphs import MultiLine
|
||||
import itertools
|
||||
from bokeh.plotting import figure, ColumnDataSource, Figure,curdoc
|
||||
from bokeh.models import CustomJS,Slider, TextInput,BoxAnnotation
|
||||
from bokeh.models import CustomJS,Slider, TextInput,BoxAnnotation, Band
|
||||
|
||||
from rowers.utils import myqueue
|
||||
import django_rq
|
||||
@@ -1694,6 +1694,13 @@ def fitnessfit_chart(workouts,user,workoutmode='water',startdate=None,
|
||||
weight = 0
|
||||
for w in ws:
|
||||
weight += getattr(w,metricchoice)
|
||||
if getattr(w,metricchoice) == 0:
|
||||
if metricchoice == 'rscore' and w.hrtss != 0:
|
||||
weight+= w.hrtss
|
||||
else:
|
||||
trimp,hrtss = dataprep.workout_trimp(w)
|
||||
rscore,normp = dataprep.workout_rscore(w)
|
||||
|
||||
|
||||
fatigue = (1-lambda_a)*fatigue+weight*lambda_a
|
||||
fitness = (1-lambda_c)*fitness+weight*lambda_c
|
||||
@@ -1790,7 +1797,7 @@ def fitnessfit_chart(workouts,user,workoutmode='water',startdate=None,
|
||||
legend_label = 'Test Score'
|
||||
yaxlabel = 'Test Score'
|
||||
else:
|
||||
legend_label = '{fitnesstest} min power'
|
||||
legend_label = '{fitnesstest} min power'.format(fitnesstest=fitnesstest)
|
||||
yaxlabel = 'Test Power (Watt)'
|
||||
|
||||
plot.circle('date','testpower',source=source,fill_color='green',size=10,
|
||||
@@ -1807,6 +1814,9 @@ def fitnessfit_chart(workouts,user,workoutmode='water',startdate=None,
|
||||
|
||||
plot.line('date','fitness',source=source,color='blue',
|
||||
legend_label=fitlabel,y_range_name="yax2")
|
||||
band = Band(base='date', upper='fitness', source=source, level='underlay',
|
||||
fill_alpha=0.2, fill_color='blue',y_range_name="yax2")
|
||||
plot.add_layout(band)
|
||||
plot.line('date','fatigue',source=source,color='red',
|
||||
legend_label=fatiguelabel,y_range_name="yax2")
|
||||
plot.line('date','form',source=source,color='green',
|
||||
|
||||
Reference in New Issue
Block a user