Private
Public Access
1
0

toggle rest stroke buttons

This commit is contained in:
Sander Roosendaal
2017-01-04 11:05:32 +01:00
parent f7d26a9e11
commit 467471437e
5 changed files with 187 additions and 150 deletions

View File

@@ -125,7 +125,7 @@ def tailwind(bearing,vwind,winddir):
from rowers.dataprep import nicepaceformat,niceformat
from rowers.dataprep import timedeltaconv
def interactive_forcecurve(theworkouts):
def interactive_forcecurve(theworkouts,workstrokesonly=False):
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
ids = [int(w.id) for w in theworkouts]
@@ -133,10 +133,21 @@ def interactive_forcecurve(theworkouts):
boattype = theworkouts[0].boattype
columns = ['catch','slip','wash','finish','averageforce',
'peakforceangle','peakforce','spm','distance']
'peakforceangle','peakforce','spm','distance',
'workoutstate']
rowdata = dataprep.getsmallrowdata_db(columns,ids=ids)
workoutstateswork = [1,4,5,8,9,6,7]
workoutstatesrest = [3]
workoutstatetransition = [0,2,10,11,12,13]
if workstrokesonly:
try:
rowdata = rowdata[~rowdata['workoutstate'].isin(workoutstatesrest)]
except KeyError:
pass
catchav = rowdata['catch'].mean()
finishav = rowdata['finish'].mean()
washav = rowdata['wash'].mean()