From 3aa567d10ea139b6a0e88e49e1e206616872275e Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 3 Jul 2017 16:24:47 +0200 Subject: [PATCH] coastal to behave as water --- rowers/views.py | 62 ++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/rowers/views.py b/rowers/views.py index f4493a48..f336270d 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -640,7 +640,7 @@ def add_workout_from_runkeeperdata(user,importid,data): times_location = times_distance latcoord = np.zeros(len(times_distance)) loncoord = np.zeros(len(times_distance)) - if workouttype == 'water': + if workouttype in ('water','coastal'): workouttype = 'rower' try: @@ -809,7 +809,7 @@ def add_workout_from_stdata(user,importid,data): times_location = times_distance latcoord = np.zeros(len(times_distance)) loncoord = np.zeros(len(times_distance)) - if workouttype == 'water': + if workouttype in ('water','coastal'): workouttype = 'rower' try: @@ -975,7 +975,7 @@ def add_workout_from_underarmourdata(user,importid,data): times_location = times_distance latcoord = np.zeros(len(times_distance)) loncoord = np.zeros(len(times_distance)) - if workouttype == 'water': + if workouttype in ('water','coastal'): workouttype = 'rower' try: @@ -2103,7 +2103,7 @@ def cum_flex(request,theuser=0, includereststrokes = options['includereststrokes'] workstrokesonly = not includereststrokes checktypes = ['water','rower','dynamic','slides','skierg', - 'paddle','snow','other'] + 'paddle','snow','coastal','other'] if deltadays>0: startdate = enddate-datetime.timedelta(days=int(deltadays)) @@ -4488,7 +4488,7 @@ def workout_geeky_view(request,id=0,message="",successmessage=""): messages.error(request,message) messages.info(request,successmessage) - if row.workouttype=='water': + if row.workouttype in ('water','coastal'): return render(request, 'otwgeeky.html', {'workout':row, @@ -4524,7 +4524,7 @@ def cumstats(request,theuser=0, includereststrokes = options['includereststrokes'] workstrokesonly = not includereststrokes checktypes = ['water','rower','dynamic','slides','skierg', - 'paddle','snow','other'] + 'paddle','snow','other','coastal'] if deltadays>0: startdate = enddate-datetime.timedelta(days=int(deltadays)) @@ -4828,7 +4828,7 @@ def workout_stats_view(request,id=0,message="",successmessage=""): normp = (pwr4.mean())**(0.25) if not np.isnan(normp): ftp = float(r.ftp) - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. intensityfactor = datadf['power'].mean()/float(ftp) @@ -4923,7 +4923,7 @@ def workout_advanced_view(request,id=0,message="",successmessage=""): messages.info(request,successmessage) - if row.workouttype=='water': + if row.workouttype in ('water','coastal'): return render(request, 'advancedotw.html', {'workout':row, @@ -5062,7 +5062,7 @@ def workout_flexchart3_view(request,*args,**kwargs): workouttype = 'ote' - if row.workouttype == 'water': + if row.workouttype in ('water','coastal'): workouttype = 'otw' try: @@ -5168,7 +5168,7 @@ def workout_flexchart3_view(request,*args,**kwargs): noylist = ["time","distance"] axchoicesbasic.pop("cumdist") - if row.workouttype == 'water': + if row.workouttype in ('water','coastal'): return render(request, 'flexchart3otw.html', {'the_script':script, @@ -5675,7 +5675,7 @@ def workout_add_otw_powerplot_view(request,id): ftp = r.ftp - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. hrpwrdata = { @@ -5693,7 +5693,7 @@ def workout_add_otw_powerplot_view(request,id): # make plot - asynchronous task plotnr = 9 - if (w.workouttype=='water'): + if w.workouttype in ('water','coastal'): plotnr = plotnr+3 if settings.DEBUG: @@ -5736,7 +5736,7 @@ def workout_add_piechart_view(request,id): r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. hrpwrdata = { @@ -5754,7 +5754,7 @@ def workout_add_piechart_view(request,id): # make plot - asynchronous task plotnr = 3 - if (w.workouttype=='water'): + if w.workouttype in ('water','coastal'): plotnr = plotnr+3 if settings.DEBUG: @@ -5797,7 +5797,7 @@ def workout_add_power_piechart_view(request,id): r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. hrpwrdata = { @@ -5815,7 +5815,7 @@ def workout_add_power_piechart_view(request,id): # make plot - asynchronous task plotnr = 13 - if (w.workouttype=='water'): + if w.workouttype in ('water','coastal'): plotnr = plotnr+3 if settings.DEBUG: @@ -5855,7 +5855,7 @@ def workout_add_timeplot_view(request,id): r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. hrpwrdata = { @@ -5873,7 +5873,7 @@ def workout_add_timeplot_view(request,id): # make plot - asynchronous task plotnr = 1 - if (w.workouttype=='water'): + if w.workouttype in ('water','coastal'): plotnr = plotnr+3 if settings.DEBUG: @@ -5915,7 +5915,7 @@ def workout_add_distanceplot_view(request,id): r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. hrpwrdata = { @@ -5933,7 +5933,7 @@ def workout_add_distanceplot_view(request,id): # make plot - asynchronous task plotnr = 2 - if (w.workouttype=='water'): + if w.workouttype in ('water','coastal'): plotnr = plotnr+3 if settings.DEBUG: @@ -5973,7 +5973,7 @@ def workout_add_distanceplot2_view(request,id): r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. hrpwrdata = { @@ -5991,7 +5991,7 @@ def workout_add_distanceplot2_view(request,id): # make plot - asynchronous task plotnr = 7 - if (w.workouttype=='water'): + if w.workouttype in ('water','coastal'): plotnr = plotnr+3 if settings.DEBUG: @@ -6033,7 +6033,7 @@ def workout_add_timeplot2_view(request,id): r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. hrpwrdata = { @@ -6051,7 +6051,7 @@ def workout_add_timeplot2_view(request,id): # make plot - asynchronous task plotnr = 8 - if (w.workouttype=='water'): + if w.workouttype in ('water','coastal'): plotnr = plotnr+3 if settings.DEBUG: @@ -6806,7 +6806,7 @@ def workout_upload_view(request, r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. hrpwrdata = { @@ -6829,7 +6829,7 @@ def workout_upload_view(request, } plotnr = plotnrs[plottype] - if (workouttype=='water'): + if workouttype in ('water','coastal'): plotnr = plotnr+3 @@ -7054,7 +7054,7 @@ def team_workout_upload_view(request,message="", r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if w.workouttype == 'water': + if w.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. hrpwrdata = { @@ -7077,7 +7077,7 @@ def team_workout_upload_view(request,message="", } plotnr = plotnrs[plottype] - if (workouttype=='water'): + if workouttype in ('water','coastal'): plotnr = plotnr+3 @@ -7267,7 +7267,7 @@ def workout_summary_restore_view(request,id,message="",successmessage=""): r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if row.workouttype == 'water': + if row.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. rr = rrower(hrmax=r.max,hrut2=r.ut2, @@ -7385,7 +7385,7 @@ def workout_summary_edit_view(request,id,message="",successmessage="" r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if row.workouttype == 'water': + if row.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. rr = rrower(hrmax=r.max,hrut2=r.ut2, @@ -8088,7 +8088,7 @@ def strokedatajson(request,id): r.pw_tr,r.pw_an])/r.ftp ftp = float(r.ftp) - if row.workouttype == 'water': + if row.workouttype in ('water','coastal'): ftp = ftp*(100.-r.otwslack)/100. rr = rrower(hrmax=r.max,hrut2=r.ut2,