diff --git a/rowers/dataprep.py b/rowers/dataprep.py
index 897805b3..69bfe263 100644
--- a/rowers/dataprep.py
+++ b/rowers/dataprep.py
@@ -2174,13 +2174,17 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True,
drivespeed = drivespeed.fillna(value=0)
try:
- driveenergy = rowdatadf['driveenergy']
+ print('driveenergy',rowdatadf['driveenergy'].mean())
except KeyError:
+ print('KeyError')
if forceunit == 'lbs':
driveenergy = drivelength * averageforce * lbstoN
else:
drivenergy = drivelength * averageforce
+ if driveenergy.mean() == 0 and driveenergy.std() == 0:
+ driveenergy = 0*driveenergy+100
+
distance = rowdatadf.loc[:, 'cum_dist']
velo = 500. / p
diff --git a/rowers/forms.py b/rowers/forms.py
index 760b536c..4e1d910c 100644
--- a/rowers/forms.py
+++ b/rowers/forms.py
@@ -820,45 +820,6 @@ class PlannedSessionMultipleCloneForm(forms.Form):
label='Planned Sessions'
)
-analysischoices = (
- ('boxplot','Box Chart'),
- ('trendflex','Trend Flex'),
- )
-
-class AnalysisChoiceForm(forms.Form):
- function = forms.ChoiceField(choices=analysischoices,initial='boxplot',
- label='Analysis')
- yparam = forms.ChoiceField(choices=parchoices,initial='spm',
- label='Metric')
- spmmin = forms.FloatField(initial=15,
- required=False,label = 'Min SPM')
- spmmax = forms.FloatField(initial=55,
- required=False,label = 'Max SPM')
- workmin = forms.FloatField(initial=0,
- required=False,label = 'Min Work per Stroke')
- workmax = forms.FloatField(initial=1500,
- required=False,label = 'Max Work per Stroke')
-
- includereststrokes = forms.BooleanField(initial=False,
- required=False,
- label='Include Rest Strokes')
-
-
-class BoxPlotChoiceForm(forms.Form):
- yparam = forms.ChoiceField(choices=parchoices,initial='spm',
- label='Metric')
- spmmin = forms.FloatField(initial=15,
- required=False,label = 'Min SPM')
- spmmax = forms.FloatField(initial=55,
- required=False,label = 'Max SPM')
- workmin = forms.FloatField(initial=0,
- required=False,label = 'Min Work per Stroke')
- workmax = forms.FloatField(initial=1500,
- required=False,label = 'Max Work per Stroke')
-
- includereststrokes = forms.BooleanField(initial=False,
- required=False,
- label='Include Rest Strokes')
grouplabels = axlabels.copy()
grouplabels['date'] = 'Date'
@@ -876,6 +837,62 @@ from rowers.utils import palettes
palettechoices = tuple((p,p) for p in palettes.keys())
+analysischoices = (
+ ('boxplot','Box Chart'),
+ ('trendflex','Trend Flex'),
+ )
+
+class AnalysisChoiceForm(forms.Form):
+ function = forms.ChoiceField(choices=analysischoices,initial='boxplot',
+ label='Analysis')
+ plotfield = forms.ChoiceField(choices=parchoices,initial='spm',
+ label='Metric')
+ xparam = forms.ChoiceField(choices=parchoicesmultiflex,
+ initial='hr',
+ label='X axis')
+ yparam = forms.ChoiceField(choices=parchoicesmultiflex,
+ initial='pace',
+ label='Y axis')
+ groupby = forms.ChoiceField(choices=groupchoices,initial='spm',
+ label='Group By')
+ binsize = forms.FloatField(initial=1,required=False,label = 'Bin Size')
+
+ ploterrorbars = forms.BooleanField(initial=False,
+ required=False,
+ label='Plot Error Bars')
+
+ palette = forms.ChoiceField(choices=palettechoices,
+ label = 'Color Scheme',
+ initial='monochrome_blue')
+
+ spmmin = forms.FloatField(initial=15,
+ required=False,label = 'Min SPM')
+ spmmax = forms.FloatField(initial=55,
+ required=False,label = 'Max SPM')
+ workmin = forms.FloatField(initial=0,
+ required=False,label = 'Min Work per Stroke')
+ workmax = forms.FloatField(initial=1500,
+ required=False,label = 'Max Work per Stroke')
+
+ includereststrokes = forms.BooleanField(initial=False,
+ required=False,
+ label='Include Rest Strokes')
+
+class BoxPlotChoiceForm(forms.Form):
+ yparam = forms.ChoiceField(choices=parchoices,initial='spm',
+ label='Metric')
+ spmmin = forms.FloatField(initial=15,
+ required=False,label = 'Min SPM')
+ spmmax = forms.FloatField(initial=55,
+ required=False,label = 'Max SPM')
+ workmin = forms.FloatField(initial=0,
+ required=False,label = 'Min Work per Stroke')
+ workmax = forms.FloatField(initial=1500,
+ required=False,label = 'Max Work per Stroke')
+
+ includereststrokes = forms.BooleanField(initial=False,
+ required=False,
+ label='Include Rest Strokes')
class MultiFlexChoiceForm(forms.Form):
xparam = forms.ChoiceField(choices=parchoicesmultiflex,
diff --git a/rowers/templates/user_analysis_select.html b/rowers/templates/user_analysis_select.html
index 8c35838d..c5ee4387 100644
--- a/rowers/templates/user_analysis_select.html
+++ b/rowers/templates/user_analysis_select.html
@@ -63,6 +63,78 @@
});
+
+