Private
Public Access
1
0

fixing reststrokes on compare plot

This commit is contained in:
Sander Roosendaal
2020-11-03 20:58:11 +01:00
parent 35830c0274
commit e2469e1eca
5 changed files with 18 additions and 8 deletions

View File

@@ -2203,6 +2203,7 @@ def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,comput
if compute and len(df):
data = df.copy()
if doclean:
print('aap')
data = clean_df_stats(data, ignorehr=True,
workstrokesonly=workstrokesonly)
data.dropna(axis=1,how='all',inplace=True)

View File

@@ -1104,10 +1104,6 @@ class AnalysisChoiceForm(forms.Form):
workmax = forms.FloatField(initial=1500,
required=False,label = 'Max Work per Stroke')
includereststrokes = forms.BooleanField(initial=False,
required=False,
label='Include Rest Strokes')
cpfitchoices = (
('data','Fit to Selected Workouts'),
('automatic','Critical Power Rolling Data')
@@ -1119,6 +1115,12 @@ class AnalysisChoiceForm(forms.Form):
piece = forms.IntegerField(initial=4,label='Ranking Piece (minutes)',
required=False)
includereststrokes = forms.BooleanField(initial=False,
required=False,
label='Include Rest Strokes')
class BoxPlotChoiceForm(forms.Form):
yparam = forms.ChoiceField(choices=parchoices,initial='spm',
label='Metric')

View File

@@ -5370,20 +5370,25 @@ def interactive_bar_chart(id=0,promember=0):
return [script,div]
def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
promember=0,
promember=0,workstrokesonly=True,
labeldict=None,startenddict={}):
message = ''
errormessage = ''
columns = [xparam,yparam,
'ftime','distance','fpace',
'power','hr','spm',
'time','pace','workoutstate',
'workoutid']
datadf = dataprep.getsmallrowdata_db(columns,ids=ids,doclean=False,compute=False)
compute = False
doclean = False
if workstrokesonly:
compute = True
doclean = True
datadf = dataprep.getsmallrowdata_db(columns,ids=ids,doclean=doclean,compute=compute,
workstrokesonly=workstrokesonly)
datadf.dropna(axis=1,how='all',inplace=True)
datadf.dropna(axis=0,how='any',inplace=True)

View File

@@ -107,7 +107,7 @@
yaxis1.hide();
yaxis2.hide();
plottype.hide();
reststrokes.hide();
// reststrokes.hide();
workmin.hide();
workmax.hide();
spmmin.hide();
@@ -147,6 +147,7 @@
yaxis1.show();
plottype.show();
piece.hide();
reststrokes.show();
}
if (functionfield.val() == 'cp') {

View File

@@ -729,6 +729,7 @@ def comparisondata(workouts,options):
res = interactive_multiple_compare_chart(ids,xparam,yparam1,
promember=promember,
plottype=plottype,
workstrokesonly=workstrokesonly,
labeldict=labeldict)
script = res[0]