diff --git a/rowers/dataprep.py b/rowers/dataprep.py index a9ad37f1..cb226c5f 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -970,8 +970,13 @@ def read_cols_df_sql(ids,columns): connection = engine.raw_connection() df = pd.read_sql_query(query,engine) df = df.fillna(value=0) + try: df['peakforce'] = df['peakforce']*lbstoN + except KeyError: + pass + + try: df['averageforce'] = df['averageforce']*lbstoN except KeyError: pass @@ -990,6 +995,10 @@ def read_df_sql(id): df = df.fillna(value=0) try: df['peakforce'] = df['peakforce']*lbstoN + except KeyError: + pass + + try: df['averageforce'] = df['averageforce']*lbstoN except KeyError: pass @@ -1037,6 +1046,10 @@ def smalldataprep(therows,xparam,yparam1,yparam2): try: df['peakforce'] = df['peakforce']*lbstoN + except KeyError: + pass + + try: df['averageforce'] = df['averageforce']*lbstoN except KeyError: pass diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index b13841e0..aa9f45c1 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -108,6 +108,14 @@ def interactive_boxchart(datadf,fieldname): months=["%d %B %Y"], years=["%d %B %Y"], ) + + if fieldname == 'pace': + plot.yaxis[0].formatter = DatetimeTickFormatter( + seconds = ["%S"], + minutes = ["%M"] + ) + + plot.xaxis.major_label_orientation = pi/4 script, div = components(plot) diff --git a/rowers/models.py b/rowers/models.py index b618a24c..fa0c839d 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -433,12 +433,14 @@ class Workout(models.Model): ownerfirst = self.user.user.first_name ownerlast = self.user.user.last_name duration = self.duration + workouttype = self.workouttype - stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {ownerfirst} {ownerlast}'.format( + stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {workouttype} {ownerfirst} {ownerlast}'.format( d = date.strftime('%Y-%m-%d'), n = name, dist = distance, duration = duration, + workouttype = workouttype, ownerfirst = ownerfirst, ownerlast = ownerlast, ) diff --git a/rowers/templates/user_boxplot_select.html b/rowers/templates/user_boxplot_select.html index 155cd3d9..e5e5c611 100644 --- a/rowers/templates/user_boxplot_select.html +++ b/rowers/templates/user_boxplot_select.html @@ -13,7 +13,11 @@
-

{{ team.name }} Team Workouts

+ {% if theuser %} +

{{ theuser.first_name }}'s Workouts

+ {% else %} +

{{ user.first_name }}'s Workouts

+ {% endif %}