added spmmin and work filtering to histo
This commit is contained in:
@@ -2175,7 +2175,7 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True,
|
|||||||
drivespeed = drivespeed.fillna(value=0)
|
drivespeed = drivespeed.fillna(value=0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print('driveenergy',rowdatadf['driveenergy'].mean())
|
driveenergy = rowdatadf['driveenergy']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
if forceunit == 'lbs':
|
if forceunit == 'lbs':
|
||||||
driveenergy = drivelength * averageforce * lbstoN
|
driveenergy = drivelength * averageforce * lbstoN
|
||||||
|
|||||||
@@ -1214,7 +1214,9 @@ def fitnessmetric_chart(fitnessmetrics,user,workoutmode='rower',startdate=None,
|
|||||||
|
|
||||||
return [script,div]
|
return [script,div]
|
||||||
|
|
||||||
def interactive_histoall(theworkouts,histoparam,includereststrokes):
|
def interactive_histoall(theworkouts,histoparam,includereststrokes,
|
||||||
|
spmmin=0,spmmax=55,
|
||||||
|
workmin=0,workmax=1500):
|
||||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||||
|
|
||||||
ids = [int(w.id) for w in theworkouts]
|
ids = [int(w.id) for w in theworkouts]
|
||||||
@@ -1224,6 +1226,12 @@ def interactive_histoall(theworkouts,histoparam,includereststrokes):
|
|||||||
|
|
||||||
rowdata.dropna(axis=0,how='any',inplace=True)
|
rowdata.dropna(axis=0,how='any',inplace=True)
|
||||||
|
|
||||||
|
rowdata = dataprep.filter_df(rowdata,'spm',spmmin,largerthan=True)
|
||||||
|
rowdata = dataprep.filter_df(rowdata,'spm',spmmax,largerthan=False)
|
||||||
|
|
||||||
|
rowdata = dataprep.filter_df(rowdata,'driveenergy',workmin,largerthan=True)
|
||||||
|
rowdata = dataprep.filter_df(rowdata,'driveenergy',workmax,largerthan=False)
|
||||||
|
|
||||||
if rowdata.empty:
|
if rowdata.empty:
|
||||||
return "","No Valid Data Available"
|
return "","No Valid Data Available"
|
||||||
|
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
@@ -58,6 +58,7 @@ def analysis_new(request,userid=0,function='boxplot'):
|
|||||||
waterboattype = mytypes.waterboattype
|
waterboattype = mytypes.waterboattype
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
thediv = get_call()
|
||||||
dateform = DateRangeForm(request.POST)
|
dateform = DateRangeForm(request.POST)
|
||||||
if dateform.is_valid():
|
if dateform.is_valid():
|
||||||
startdate = dateform.cleaned_data['startdate']
|
startdate = dateform.cleaned_data['startdate']
|
||||||
@@ -105,6 +106,7 @@ def analysis_new(request,userid=0,function='boxplot'):
|
|||||||
ids = []
|
ids = []
|
||||||
options['ids'] = ids
|
options['ids'] = ids
|
||||||
else:
|
else:
|
||||||
|
thediv = ''
|
||||||
dateform = DateRangeForm(initial={
|
dateform = DateRangeForm(initial={
|
||||||
'startdate':startdate,
|
'startdate':startdate,
|
||||||
'enddate':enddate,
|
'enddate':enddate,
|
||||||
@@ -209,6 +211,7 @@ def analysis_new(request,userid=0,function='boxplot'):
|
|||||||
'rower':r,
|
'rower':r,
|
||||||
'breadcrumbs':breadcrumbs,
|
'breadcrumbs':breadcrumbs,
|
||||||
'theuser':user,
|
'theuser':user,
|
||||||
|
'the_div':thediv,
|
||||||
'form':form,
|
'form':form,
|
||||||
'active':'nav-analysis',
|
'active':'nav-analysis',
|
||||||
'chartform':chartform,
|
'chartform':chartform,
|
||||||
@@ -416,10 +419,16 @@ def histodata(workouts, options):
|
|||||||
includereststrokes = options['includereststrokes']
|
includereststrokes = options['includereststrokes']
|
||||||
plotfield = options['plotfield']
|
plotfield = options['plotfield']
|
||||||
function = options['function']
|
function = options['function']
|
||||||
|
spmmin = options['spmmin']
|
||||||
|
spmmax = options['spmmax']
|
||||||
|
workmin = options['workmin']
|
||||||
|
workmax = options['workmax']
|
||||||
|
|
||||||
|
|
||||||
workstrokesonly = not includereststrokes
|
workstrokesonly = not includereststrokes
|
||||||
|
|
||||||
script, div = interactive_histoall(workouts,plotfield,includereststrokes)
|
script, div = interactive_histoall(workouts,plotfield,includereststrokes,
|
||||||
|
spmmin=spmmin,spmmax=spmmax,workmin=workmin,workmax=workmax)
|
||||||
|
|
||||||
|
|
||||||
scripta = script.split('\n')[2:-1]
|
scripta = script.split('\n')[2:-1]
|
||||||
@@ -2954,6 +2963,8 @@ def multiflex_data(request,userid=0,
|
|||||||
'ploterrorbars':False,
|
'ploterrorbars':False,
|
||||||
}):
|
}):
|
||||||
|
|
||||||
|
def_options = options
|
||||||
|
|
||||||
if 'options' in request.session:
|
if 'options' in request.session:
|
||||||
options = request.session['options']
|
options = request.session['options']
|
||||||
|
|
||||||
@@ -2978,16 +2989,16 @@ def multiflex_data(request,userid=0,
|
|||||||
userid = request.user.id
|
userid = request.user.id
|
||||||
|
|
||||||
|
|
||||||
palette = options['palette']
|
palette = keyvalue_get_default('palette',options, def_options)
|
||||||
groupby = options['groupby']
|
groupby = keyvalue_get_default('groupby',options, def_options)
|
||||||
binsize = options['binsize']
|
binsize = keyvalue_get_default('binsize',options, def_options)
|
||||||
xparam = options['xparam']
|
xparam = keyvalue_get_default('xparam',options, def_options)
|
||||||
yparam = options['yparam']
|
yparam = keyvalue_get_default('yparam',options, def_options)
|
||||||
spmmin = options['spmmin']
|
spmmin = keyvalue_get_default('spmmin',options, def_options)
|
||||||
spmmax = options['spmmax']
|
spmmax = keyvalue_get_default('spmmax',options, def_options)
|
||||||
workmin = options['workmin']
|
workmin = keyvalue_get_default('workmin',options, def_options)
|
||||||
workmax = options['workmax']
|
workmax = keyvalue_get_default('workmax',options, def_options)
|
||||||
ids = options['ids']
|
ids = keyvalue_get_default('ids',options, def_options)
|
||||||
|
|
||||||
workouts = []
|
workouts = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user