diff --git a/cvkbrno/templates/cvkbrno_boat_add_form.html b/cvkbrno/templates/cvkbrno_boat_add_form.html index 9cb2478b..9327fabd 100644 --- a/cvkbrno/templates/cvkbrno_boat_add_form.html +++ b/cvkbrno/templates/cvkbrno_boat_add_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Create Boat" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_boat_delete_confirm.html b/cvkbrno/templates/cvkbrno_boat_delete_confirm.html index 351a4293..7f032a70 100644 --- a/cvkbrno/templates/cvkbrno_boat_delete_confirm.html +++ b/cvkbrno/templates/cvkbrno_boat_delete_confirm.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} diff --git a/cvkbrno/templates/cvkbrno_boat_edit_form.html b/cvkbrno/templates/cvkbrno_boat_edit_form.html index 52e08559..1a74b248 100644 --- a/cvkbrno/templates/cvkbrno_boat_edit_form.html +++ b/cvkbrno/templates/cvkbrno_boat_edit_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Edit Boat" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_boats_admin.html b/cvkbrno/templates/cvkbrno_boats_admin.html index a9598bf6..972bdc56 100644 --- a/cvkbrno/templates/cvkbrno_boats_admin.html +++ b/cvkbrno/templates/cvkbrno_boats_admin.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Boats Admin" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_categories_admin.html b/cvkbrno/templates/cvkbrno_categories_admin.html index d1f245a2..3d6d24ae 100644 --- a/cvkbrno/templates/cvkbrno_categories_admin.html +++ b/cvkbrno/templates/cvkbrno_categories_admin.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Boat Category Admin" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_categories_delete_confirm.html b/cvkbrno/templates/cvkbrno_categories_delete_confirm.html index d9415b2b..a4b1aca1 100644 --- a/cvkbrno/templates/cvkbrno_categories_delete_confirm.html +++ b/cvkbrno/templates/cvkbrno_categories_delete_confirm.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Delete Boat Category" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_categories_edit_form.html b/cvkbrno/templates/cvkbrno_categories_edit_form.html index 29715c8a..fba0ee92 100644 --- a/cvkbrno/templates/cvkbrno_categories_edit_form.html +++ b/cvkbrno/templates/cvkbrno_categories_edit_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Edit Category" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_category_add_form.html b/cvkbrno/templates/cvkbrno_category_add_form.html index 697e89f5..655bc4ff 100644 --- a/cvkbrno/templates/cvkbrno_category_add_form.html +++ b/cvkbrno/templates/cvkbrno_category_add_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Create Category" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_member_add_form.html b/cvkbrno/templates/cvkbrno_member_add_form.html index 9f035086..673467f6 100644 --- a/cvkbrno/templates/cvkbrno_member_add_form.html +++ b/cvkbrno/templates/cvkbrno_member_add_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Create Member" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_member_edit_form.html b/cvkbrno/templates/cvkbrno_member_edit_form.html index fa3e6ae7..f1aed60b 100644 --- a/cvkbrno/templates/cvkbrno_member_edit_form.html +++ b/cvkbrno/templates/cvkbrno_member_edit_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Edit Member" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_members_admin.html b/cvkbrno/templates/cvkbrno_members_admin.html index a9c24caa..7f83aa51 100644 --- a/cvkbrno/templates/cvkbrno_members_admin.html +++ b/cvkbrno/templates/cvkbrno_members_admin.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Members Admin" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_members_delete_confirm.html b/cvkbrno/templates/cvkbrno_members_delete_confirm.html index 414a9c87..11b360e9 100644 --- a/cvkbrno/templates/cvkbrno_members_delete_confirm.html +++ b/cvkbrno/templates/cvkbrno_members_delete_confirm.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Delete Member" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_memberswork_add_form.html b/cvkbrno/templates/cvkbrno_memberswork_add_form.html index f5f3c004..831fb127 100644 --- a/cvkbrno/templates/cvkbrno_memberswork_add_form.html +++ b/cvkbrno/templates/cvkbrno_memberswork_add_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Create Members Work" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_memberswork_admin.html b/cvkbrno/templates/cvkbrno_memberswork_admin.html index f2af7385..3414bc23 100644 --- a/cvkbrno/templates/cvkbrno_memberswork_admin.html +++ b/cvkbrno/templates/cvkbrno_memberswork_admin.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Members Work Admin" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_memberwork_edit_form.html b/cvkbrno/templates/cvkbrno_memberwork_edit_form.html index 8a4baf4b..c27ccfeb 100644 --- a/cvkbrno/templates/cvkbrno_memberwork_edit_form.html +++ b/cvkbrno/templates/cvkbrno_memberwork_edit_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Edit Member Work" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_meterboard.html b/cvkbrno/templates/cvkbrno_meterboard.html index 618914de..b88b3120 100644 --- a/cvkbrno/templates/cvkbrno_meterboard.html +++ b/cvkbrno/templates/cvkbrno_meterboard.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Meterboard" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_outing_admin.html b/cvkbrno/templates/cvkbrno_outing_admin.html index 6d702066..6dbccf9b 100644 --- a/cvkbrno/templates/cvkbrno_outing_admin.html +++ b/cvkbrno/templates/cvkbrno_outing_admin.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load filter %} {% load tz %} diff --git a/cvkbrno/templates/cvkbrno_outing_closeform.html b/cvkbrno/templates/cvkbrno_outing_closeform.html index 02bb3cf1..a6b38809 100644 --- a/cvkbrno/templates/cvkbrno_outing_closeform.html +++ b/cvkbrno/templates/cvkbrno_outing_closeform.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Return from outing" %} diff --git a/cvkbrno/templates/cvkbrno_outing_form.html b/cvkbrno/templates/cvkbrno_outing_form.html index d10da855..6c04a751 100644 --- a/cvkbrno/templates/cvkbrno_outing_form.html +++ b/cvkbrno/templates/cvkbrno_outing_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load tz %} diff --git a/cvkbrno/templates/cvkbrno_races_form.html b/cvkbrno/templates/cvkbrno_races_form.html index 7c0b7ab9..cd6b343e 100644 --- a/cvkbrno/templates/cvkbrno_races_form.html +++ b/cvkbrno/templates/cvkbrno_races_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Create Races Event" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_races_list.html b/cvkbrno/templates/cvkbrno_races_list.html index 48aa8cd6..8fcd3393 100644 --- a/cvkbrno/templates/cvkbrno_races_list.html +++ b/cvkbrno/templates/cvkbrno_races_list.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{% trans "Races Admin" %}{% endblock %} diff --git a/cvkbrno/templates/cvkbrno_reservation_form.html b/cvkbrno/templates/cvkbrno_reservation_form.html index 50dbfa56..d7a45bbe 100644 --- a/cvkbrno/templates/cvkbrno_reservation_form.html +++ b/cvkbrno/templates/cvkbrno_reservation_form.html @@ -1,6 +1,6 @@ {% extends "cvkbrnobase.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load tz %} diff --git a/cvkbrno/templates/cvkbrno_setlanguage.html b/cvkbrno/templates/cvkbrno_setlanguage.html index 9f93455d..d05f741e 100644 --- a/cvkbrno/templates/cvkbrno_setlanguage.html +++ b/cvkbrno/templates/cvkbrno_setlanguage.html @@ -1,5 +1,5 @@ {% extends "cvkbrnobase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Jdu na vodu {% endblock %} diff --git a/rowers/c2stuff.py b/rowers/c2stuff.py index 2ad32bd1..2540fc07 100644 --- a/rowers/c2stuff.py +++ b/rowers/c2stuff.py @@ -773,14 +773,12 @@ def createc2workoutdata(w): if workouttype in otwtypes: workouttype = 'water' - try: - startdatetime = w.startdatetime.isoformat() - except AttributeError: - startdate = datetime.datetime.combine(w.date,datetime.time()) + + wendtime = w.startdatetime-datetime.timedelta(seconds=makeseconds(durationstr)) data = { "type": mytypes.c2mapping[workouttype], - "date": w.startdatetime.isoformat(), + "date": wendtime.strftime('%Y-%m-%d %H:%M:%S'), #w.startdatetime.isoformat(), "stroke_count": int(row.stroke_count), "timezone": w.timezone, "distance": int(w.distance), diff --git a/rowers/dataprep.py b/rowers/dataprep.py index c91ea326..d7d7ae4b 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -1858,7 +1858,6 @@ def parsenonpainsled(fileformat,f2,summary,startdatetime='',empowerfirmware=None if fileformat == 'nklinklogbook' and empowerfirmware is not None: if inboard is not None and oarlength is not None: row = NKLiNKLogbookParser(f2,firmware=empowerfirmware,inboard=inboard,oarlength=oarlength) - print(row,'aap') else: row = NKLiNKLogbookParser(f2) else: @@ -3038,7 +3037,6 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True, df = dd.from_pandas(data,npartitions=1) df.to_parquet(filename,engine='fastparquet',compression='GZIP') - return data diff --git a/rowers/dataprepnodjango.py b/rowers/dataprepnodjango.py index e892d896..4c08ebb4 100644 --- a/rowers/dataprepnodjango.py +++ b/rowers/dataprepnodjango.py @@ -754,9 +754,6 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True, print("empty") return 0 - if debug: - print("dataprep",id) - # rowdatadf.set_index([range(len(rowdatadf))],inplace=True) t = rowdatadf.loc[:,'TimeStamp (sec)'] t = pd.Series(t-rowdatadf.loc[:,'TimeStamp (sec)'].iloc[0]) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 3887e29d..b406619d 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -145,7 +145,7 @@ def errorbar(fig, x, y, source=ColumnDataSource(), yerrvalues = source.data['yerror'] try: colorvalues = source.data['color'] - except KeyError: + except KeyError: # pragma: no cover colorvalues = ["#%02x%02x%02x" % (255,0,0) for x in xvalues] @@ -168,7 +168,7 @@ def errorbar(fig, x, y, source=ColumnDataSource(), fig.multi_line(x_err_x, x_err_y, color=err_color, name='xerr', **error_kwargs) - except TypeError: + except TypeError: # pragma: no cover pass try: @@ -189,7 +189,7 @@ def errorbar(fig, x, y, source=ColumnDataSource(), fig.multi_line(y_err_x, y_err_y, color=err_color, name='yerr',**error_kwargs) - except TypeError: + except TypeError: # pragma: no cover pass fig.circle(x, y, source=source, name='data',color=color, @@ -317,7 +317,7 @@ def pretty_timedelta(secs): def mapcolors(x): try: return mytypes.color_map[x] - except KeyError: + except KeyError: # pragma: no cover return mytypes.colors[-1] def interactive_workouttype_piechart(workouts): @@ -331,7 +331,7 @@ def interactive_workouttype_piechart(workouts): try: # label = mytypes.workouttypes_ordered[w.workouttype] label = w.workouttype - except KeyError: + except KeyError: # pragma: no cover label = w.workouttype try: datadict[label] += 60*(60*w.duration.hour+w.duration.minute)+w.duration.second @@ -350,7 +350,7 @@ def interactive_workouttype_piechart(workouts): data['totaltime'] = data['value'].apply(lambda x:pretty_timedelta(x)) try: data['type'] = data['type'].apply(lambda x:mytypes.workouttypes_ordered[x]) - except KeyError: + except KeyError: # pragma: no cover pass @@ -376,15 +376,15 @@ def interactive_workouttype_piechart(workouts): def interactive_boxchart(datadf,fieldname,extratitle='', spmmin=0,spmmax=0,workmin=0,workmax=0): - if datadf.empty: + if datadf.empty: # pragma: no cover return '','It looks like there are no data matching your filter' columns = datadf.columns - if not fieldname in columns: + if not fieldname in columns: # pragma: no cover return '','It looks like there are no data matching your filter' - if not 'date' in columns: + if not 'date' in columns: # pragma: no cover return '','Not enough data' @@ -402,7 +402,7 @@ def interactive_boxchart(datadf,fieldname,extratitle='', try: boxwhiskers = hv.BoxWhisker(datadf,'date',fieldname) boxwhiskers.opts(tools=TOOLS,outlier_color='white') - except DataError: + except DataError: # pragma: no cover return "","Invalid Data" @@ -422,7 +422,7 @@ def interactive_boxchart(datadf,fieldname,extratitle='', years=["%d %B %Y"], ) - if fieldname == 'pace': + if fieldname == 'pace': # pragma: no cover plot.yaxis[0].formatter = DatetimeTickFormatter( seconds = ["%S"], minutes = ["%M"] @@ -458,10 +458,10 @@ def interactive_planchart(data,startdate,enddate): yaxmaximum = data['executed'].max() - if data['planned'].max() > yaxmaximum: + if data['planned'].max() > yaxmaximum: # pragma: no cover yaxmaximum = data['planned'].max() - if yaxmaximum == 0: + if yaxmaximum == 0: # pragma: no cover yaxmaximum = 250 yrange1 = Range1d(start=0,end=1.1*yaxmaximum) @@ -513,7 +513,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type',toolbar_lo aantal=1 initials = w.user.user.first_name[0:aantal]+w.user.user.last_name[0:aantal] if w.user.id not in idseen: - while initials in seen: + while initials in seen: # pragma: no cover aantal += 1 initials = w.user.user.first_name[0:aantal]+w.user.user.last_name[0:aantal] @@ -531,13 +531,13 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type',toolbar_lo rscore = w.rscore trimp = w.trimp - if rscore == 0: + if rscore == 0: # pragma: no cover rscore = w.hrtss if totaldays<30: dates.append(dd) dates_sorting.append(dd2) - else: + else: # pragma: no cover dates.append(dd3) dates_sorting.append(dd3) durations.append(du) @@ -554,17 +554,17 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type',toolbar_lo types.append(w.workouttype) try: rowers.append(rowersinitials[w.user.id]) - except IndexError: + except IndexError: # pragma: no cover rowers.append(str(w.user)) try: d = utc.localize(startdate) - except (ValueError,AttributeError): + except (ValueError,AttributeError): # pragma: no cover d = startdate try: enddate = utc.localize(enddate) - except (ValueError,AttributeError): + except (ValueError,AttributeError): # pragma: no cover pass # add dates with no activity @@ -575,7 +575,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type',toolbar_lo if totaldays<30: dates.append(d.strftime('%m/%d')) dates_sorting.append(d.strftime('%Y/%m/%d')) - else: + else: # pragma: no cover dates.append(d.strftime('%Y/%m')) dates_sorting.append(d.strftime('%Y/%m')) durations.append(0) @@ -699,7 +699,7 @@ def interactive_activitychart2(workouts,startdate,enddate,stack='type',toolbar_l aantal=1 initials = w.user.user.first_name[0:aantal]+w.user.user.last_name[0:aantal] if w.user.id not in idseen: - while initials in seen: + while initials in seen: # pragma: no cover aantal += 1 initials = w.user.user.first_name[0:aantal]+w.user.user.last_name[0:aantal] @@ -716,10 +716,10 @@ def interactive_activitychart2(workouts,startdate,enddate,stack='type',toolbar_l du = w.duration.hour*60+w.duration.minute trimp = w.trimp rscore = w.rscore - if rscore == 0: + if rscore == 0: # pragma: no cover rscore = w.hrtss - if totaldays<30: + if totaldays<30: # pragma: no cover dates.append(dd) dates_sorting.append(dd2) else: @@ -739,17 +739,17 @@ def interactive_activitychart2(workouts,startdate,enddate,stack='type',toolbar_l types.append(w.workouttype) try: rowers.append(rowersinitials[w.user.id]) - except IndexError: + except IndexError: # pragma: no cover rowers.append(str(w.user)) try: d = utc.localize(startdate) - except (ValueError,AttributeError): + except (ValueError,AttributeError): # pragma: no cover d = startdate try: enddate = utc.localize(enddate) - except (ValueError,AttributeError): + except (ValueError,AttributeError): # pragma: no cover pass # add dates with no activity @@ -875,7 +875,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): if workstrokesonly: try: rowdata = rowdata[~rowdata['workoutstate'].isin(workoutstatesrest)] - except KeyError: + except KeyError: # pragma: no cover pass if rowdata.empty: @@ -886,7 +886,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): # peakforce = slope*peakforceangle + intercept try: slope, intercept, r,p,stderr = linregress(rowdata['peakforceangle'],rowdata['peakforce']) - except KeyError: + except KeyError: # pragma: no cover slope = 0 intercept = 0 @@ -938,7 +938,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): a95b = Rinv[0,1]*y95 + rowdata['peakforceangle'].median() F95b = Rinv[1,1]*y95 + rowdata['peakforce'].median() - except KeyError: + except KeyError: # pragma: no cover a25 = 0 F25 = 0 @@ -972,7 +972,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): catch75 = rowdata['catch'].quantile(q=0.75) catch05 = rowdata['catch'].quantile(q=0.05) catch95 = rowdata['catch'].quantile(q=0.95) - except KeyError: + except KeyError: # pragma: no cover catchav = 0 catch25 = 0 catch75 = 0 @@ -985,7 +985,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): finish75 = rowdata['finish'].quantile(q=0.75) finish05 = rowdata['finish'].quantile(q=0.05) finish95 = rowdata['finish'].quantile(q=0.95) - except KeyError: + except KeyError: # pragma: no cover finishav = 0 finish25 = 0 finish75 = 0 @@ -998,7 +998,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): wash75 = (rowdata['finish']-rowdata['wash']).quantile(q=0.75) wash05 = (rowdata['finish']-rowdata['wash']).quantile(q=0.05) wash95 = (rowdata['finish']-rowdata['wash']).quantile(q=0.95) - except KeyError: + except KeyError: # pragma: no cover washav = 0 wash25 = 0 wash75 = 0 @@ -1011,7 +1011,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): slip75 = (rowdata['slip']+rowdata['catch']).quantile(q=0.75) slip05 = (rowdata['slip']+rowdata['catch']).quantile(q=0.05) slip95 = (rowdata['slip']+rowdata['catch']).quantile(q=0.95) - except KeyError: + except KeyError: # pragma: no cover slipav = 0 slip25 = 0 slip75 = 0 @@ -1024,7 +1024,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): peakforce75 = rowdata['peakforce'].quantile(q=0.75) peakforce05 = rowdata['peakforce'].quantile(q=0.05) peakforce95 = rowdata['peakforce'].quantile(q=0.95) - except KeyError: + except KeyError: # pragma: no cover peakforceav = 0 peakforce25 = 0 peakforce75 = 0 @@ -1034,7 +1034,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): try: averageforceav = rowdata['averageforce'].median() - except KeyError: + except KeyError: # pragma: no cover averageforceav = 0 try: @@ -1043,7 +1043,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): peakforceangle25 = rowdata['peakforceangle'].quantile(q=0.25) peakforceangle75 = rowdata['peakforceangle'].quantile(q=0.75) peakforceangle95 = rowdata['peakforceangle'].quantile(q=0.95) - except KeyError: + except KeyError: # pragma: no cover peakforceangleav = 0 peakforceangle25 = 0 peakforceangle75 = 0 @@ -1147,7 +1147,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): rowdata ) - if plottype == 'scatter': + if plottype == 'scatter': # pragma: no cover try: sourcepoints = ColumnDataSource( data = dict( @@ -1240,7 +1240,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): rowdata['peakforce'].values[i], thresholdforce, 0] - except KeyError: + except KeyError: # pragma: no cover x = [0,0] y = [0,0] @@ -1259,7 +1259,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): glyph = MultiLine(xs='x',ys='y',line_color='black',line_alpha=0.05) plot.add_glyph(sourcemultiline,glyph) - else: + else: # pragma: no cover sourcemultiline = ColumnDataSource(dict( x=[],y=[])) @@ -1556,13 +1556,13 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): slider_dist_max.js_on_change('value',callback) callback.args["maxdist"] = slider_dist_max - annotation.sizing_mode = 'fixed' - slider_spm_min.sizing_mode = 'fixed' - slider_spm_max.sizing_mode = 'fixed' - slider_work_min.sizing_mode = 'fixed' - slider_work_max.sizing_mode = 'fixed' - slider_dist_min.sizing_mode = 'fixed' - slider_dist_max.sizing_mode = 'fixed' + #annotation.sizing_mode = 'fixed' + #slider_spm_min.sizing_mode = 'fixed' + #slider_spm_max.sizing_mode = 'fixed' + #slider_work_min.sizing_mode = 'fixed' + #slider_work_max.sizing_mode = 'fixed' + #slider_dist_min.sizing_mode = 'fixed' + #slider_dist_max.sizing_mode = 'fixed' thesliders = layoutcolumn([annotation, slider_spm_min, @@ -1573,7 +1573,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'): slider_work_max, ] ) - thesliders.sizing_mode = 'fixed' + #thesliders.sizing_mode = 'fixed' layout = layoutrow([thesliders, plot]) @@ -1613,12 +1613,12 @@ def getfatigues( if getattr(w,metricchoice) > 0: weight += getattr(w,metricchoice) if getattr(w,metricchoice) <= 0: - if metricchoice == 'rscore' and w.hrtss > 0: + if metricchoice == 'rscore' and w.hrtss > 0: # pragma: no cover weight+= w.hrtss else: trimp,hrtss = dataprep.workout_trimp(w) rscore,normp = dataprep.workout_rscore(w) - if w.rpe and w.rpe > 0: + if w.rpe and w.rpe > 0: # pragma: no cover dd = 3600*w.duration.hour+60*w.duration.minute+w.duration.second dd = dd/3600 weight += rpetotss[w.rpe]*dd @@ -1886,7 +1886,7 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7, endfatigue = fatigues[-2] endform = endfitness-endfatigue - if modelchoice == 'banister': + if modelchoice == 'banister': # pragma: no cover df['fatigue'] = k2*df['fatigue'] df['fitness'] = p0+k1*df['fitness'] @@ -1900,9 +1900,6 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7, df['date'] = df.index.values - #for row in df.iterrows(): - # print(row) - source = ColumnDataSource( data = dict( testpower = df['testpower'], @@ -1949,7 +1946,7 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7, y_range_name = "watermark", ) - if modelchoice == 'banister': + if modelchoice == 'banister': # pragma: no cover fitlabel = 'PTE (fitness)' fatiguelabel = 'NTE (fatigue)' formlabel = 'Performance' @@ -1963,7 +1960,7 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7, fatiguelabel = 'Fatigue' formlabel = 'Freshness' rightaxlabel = 'Freshness' - if dofatigue: + if dofatigue: # pragma: no cover yaxlabel = 'Fitness/Fatigue' else: yaxlabel = 'Fitness' @@ -1985,14 +1982,14 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7, #elif showtests: # y1rangemin = df.loc[:,['testpower','fitness']].min().min() # y1rangemax = df.loc[:,['testpower','fitness']].max().max()*1.02 - if dofatigue: + if dofatigue: # pragma: no cover y1rangemin = df.loc[:,['fitness','fatigue']].min().min() y1rangemax = df.loc[:,['fitness','fatigue']].max().max()*1.02 else: y1rangemin = df.loc[:,['fitness']].min().min() y1rangemax = df.loc[:,['fitness']].max().max()*1.02 - if doform: + if doform: # pragma: no cover plot.extra_y_ranges["yax2"] = Range1d(start=y2rangemin,end=y2rangemax) plot.add_layout(LinearAxis(y_range_name="yax2",axis_label=rightaxlabel),"right") @@ -2003,10 +2000,10 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7, plot.add_layout(band) - if dofatigue: + if dofatigue: # pragma: no cover plot.line('date','fatigue',source=source,color='red', legend_label=fatiguelabel) - if doform: + if doform: # pragma: no cover plot.line('date','form',source=source,color='green', legend_label=formlabel,y_range_name="yax2") @@ -2079,7 +2076,7 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7, try: script,div = components(layout) - except Exception as e: + except Exception as e: # pragma: no cover df.dropna(inplace=True,axis=0,how='any') return ( '', @@ -2120,7 +2117,7 @@ def interactive_histoall(theworkouts,histoparam,includereststrokes, histopwr = rowdata[histoparam].values except KeyError: return "","No data" - if len(histopwr) == 0: + if len(histopwr) == 0: # pragma: no cover return "","No valid data available" # throw out nans @@ -2226,7 +2223,7 @@ def interactive_histoall(theworkouts,histoparam,includereststrokes, try: script, div = components(layout) - except ValueError: + except ValueError: # pragma: no cover script = '' div = '' @@ -2388,7 +2385,7 @@ def course_map(course): return script,div def leaflet_chart(lat,lon,name=""): - if lat.empty or lon.empty: + if lat.empty or lon.empty: # pragma: no cover return [0,"invalid coordinate data"] @@ -2404,7 +2401,7 @@ def leaflet_chart(lat,lon,name=""): df.fillna(method='ffill',axis=0,inplace=True) lat = df['lat'] lon = df['lon'] - if lat.empty or lon.empty: + if lat.empty or lon.empty: # pragma: no cover return [0,"invalid coordinate data"] latmean = lat.mean() @@ -2542,7 +2539,7 @@ def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}): 'time':time-time[0], }) data.append(df) - except (Workout.DoesNotExist,KeyError): + except (Workout.DoesNotExist,KeyError): # pragma: no cover pass @@ -2607,7 +2604,7 @@ def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}): lat = df['lat'] lon = df['lon'] - if lat.empty or lon.empty: + if lat.empty or lon.empty: # pragma: no cover return [0,"invalid coordinate data"] latbegin = lat.values[0] @@ -2715,13 +2712,13 @@ var navionics = new JNC.Leaflet.NavionicsOverlay({{ group = df[df['workoutid']==int(id)].copy() try: startsecond,endsecond = startenddict[id] - except KeyError: + except KeyError: # pragma: no cover startsecond = 0 endsecond = 0 try: label = labeldict[id] - except KeyError: + except KeyError: # pragma: no cover label = str(id) group.sort_values(by='time',ascending=True,inplace=True) @@ -2780,7 +2777,7 @@ var navionics = new JNC.Leaflet.NavionicsOverlay({{ return script,div def leaflet_chart2(lat,lon,name=""): - if lat.empty or lon.empty: + if lat.empty or lon.empty: # pragma: no cover return [0,"invalid coordinate data"] @@ -2796,7 +2793,7 @@ def leaflet_chart2(lat,lon,name=""): df.fillna(method='ffill',axis=0,inplace=True) lat = df['lat'] lon = df['lon'] - if lat.empty or lon.empty: + if lat.empty or lon.empty: # pragma: no cover return [0,"invalid coordinate data"] latmean = lat.mean() @@ -2919,7 +2916,7 @@ def leaflet_chart2(lat,lon,name=""): return script,div def leaflet_chart_video(lat,lon,name=""): - if not len(lat) or not len(lon): + if not len(lat) or not len(lon): # pragma: no cover return [0,"invalid coordinate data"] @@ -2935,7 +2932,7 @@ def leaflet_chart_video(lat,lon,name=""): df.fillna(method='ffill',axis=0,inplace=True) lat = df['lat'] lon = df['lon'] - if lat.empty or lon.empty: + if lat.empty or lon.empty: # pragma: no cover return [0,"invalid coordinate data"] latmean = lat.mean() @@ -3072,7 +3069,7 @@ def interactive_agegroupcpchart(age,normalized=False): weightcategory='hwt' ) velo = (worldclasspower/2.8)**(1./3.) - try: + try: # pragma: no cover duration = distance/velo fhduration.append(duration) fhpower.append(worldclasspower) @@ -3090,7 +3087,7 @@ def interactive_agegroupcpchart(age,normalized=False): distance = int(60*duration*velo) fhduration.append(60.*duration) fhpower.append(worldclasspower) - except ValueError: + except ValueError: # pragma: no cover pass flduration = [] @@ -3104,7 +3101,7 @@ def interactive_agegroupcpchart(age,normalized=False): weightcategory='lwt' ) velo = (worldclasspower/2.8)**(1./3.) - try: + try: # pragma: no cover duration = distance/velo flduration.append(duration) flpower.append(worldclasspower) @@ -3122,7 +3119,7 @@ def interactive_agegroupcpchart(age,normalized=False): distance = int(60*duration*velo) flduration.append(60.*duration) flpower.append(worldclasspower) - except ValueError: + except ValueError: # pragma: no cover pass mlduration = [] @@ -3136,12 +3133,13 @@ def interactive_agegroupcpchart(age,normalized=False): weightcategory='lwt' ) velo = (worldclasspower/2.8)**(1./3.) - try: + try: # pragma: no cover duration = distance/velo mlduration.append(duration) mlpower.append(worldclasspower) except ZeroDivisionError: - pass + mlduration.append(duration) + mlpower.append(np.nan) for duration in durations: worldclasspower = c2stuff.getagegrouprecord( age, @@ -3154,8 +3152,9 @@ def interactive_agegroupcpchart(age,normalized=False): distance = int(60*duration*velo) mlduration.append(60.*duration) mlpower.append(worldclasspower) - except ValueError: - pass + except ValueError: # pragma: no cover + mlduration.append(60.*duration) + mlpower.append(np.nan) mhduration = [] @@ -3169,12 +3168,13 @@ def interactive_agegroupcpchart(age,normalized=False): weightcategory='hwt' ) velo = (worldclasspower/2.8)**(1./3.) - try: + try: # pragma: no cover duration = distance/velo mhduration.append(duration) mhpower.append(worldclasspower) except ZeroDivisionError: - pass + mhduration.append(duration) + mhpower.append(np.nan) for duration in durations: worldclasspower = c2stuff.getagegrouprecord( age, @@ -3187,8 +3187,9 @@ def interactive_agegroupcpchart(age,normalized=False): distance = int(60*duration*velo) mhduration.append(60.*duration) mhpower.append(worldclasspower) - except ValueError: - pass + except ValueError: # pragma: no cover + mhduration.append(60.*duration) + mhpower.append(np.nan) @@ -3201,27 +3202,27 @@ def interactive_agegroupcpchart(age,normalized=False): if len(fhduration)>=4: p1fh, success = optimize.leastsq(errfunc, p0[:], args = (fhduration,fhpower)) - else: + else: # pragma: no cover p1fh = None # fitting WC data to three parameter CP model if len(flduration)>=4: p1fl, success = optimize.leastsq(errfunc, p0[:], args = (flduration,flpower)) - else: + else: # pragma: no cover p1fl = None # fitting WC data to three parameter CP model if len(mlduration)>=4: p1ml, success = optimize.leastsq(errfunc, p0[:], args = (mlduration,mlpower)) - else: + else: # pragma: no cover p1ml = None if len(mhduration)>=4: p1mh, success = optimize.leastsq(errfunc, p0[:], args = (mhduration,mhpower)) - else: + else: # pragma: no cover p1mh = None fitt = pd.Series(10**(4*np.arange(100)/100.)) @@ -3247,23 +3248,43 @@ def interactive_agegroupcpchart(age,normalized=False): - source = ColumnDataSource( + sourcemh = ColumnDataSource( + data = dict( + mhduration = mhduration, + mhpower = mhpower, + ) + ) + + sourcefl = ColumnDataSource( + data = dict( + flduration = flduration, + flpower = flpower, + ) + ) + + sourcefh = ColumnDataSource( + data = dict( + fhduration = fhduration, + fhpower = fhpower, + ) + ) + + sourceml = ColumnDataSource( + data = dict( + mlduration = mlduration, + mlpower = mlpower, + ) + ) + + sourcefit = ColumnDataSource( data = dict( duration = fitt, fitpowerfh = fitpowerfh, fitpowerfl = fitpowerfl, fitpowerml = fitpowerml, fitpowermh = fitpowermh, - flduration = flduration, - flpower = flpower, - fhduration = fhduration, - fhpower = fhpower, - mlduration = mlduration, - mlpower = mlpower, - mhduration = mhduration, - mhpower = mhpower, - ) ) + ) x_axis_type = 'log' y_axis_type = 'linear' @@ -3274,28 +3295,28 @@ def interactive_agegroupcpchart(age,normalized=False): tools=TOOLS) plot.sizing_mode = 'stretch_both' - plot.line('duration','fitpowerfh',source=source, + plot.line('duration','fitpowerfh',source=sourcefit, legend_label='Female HW',color='blue') - plot.line('duration','fitpowerfl',source=source, + plot.line('duration','fitpowerfl',source=sourcefit, legend_label='Female LW',color='red') - plot.line('duration','fitpowerml',source=source, + plot.line('duration','fitpowerml',source=sourcefit, legend_label='Male LW',color='green') - plot.line('duration','fitpowermh',source=source, + plot.line('duration','fitpowermh',source=sourcefit, legend_label='Male HW',color='orange') - plot.circle('flduration','flpower',source=source, + plot.circle('flduration','flpower',source=sourcefl, fill_color='red',size=15) - plot.circle('fhduration','fhpower',source=source, + plot.circle('fhduration','fhpower',source=sourcefh, fill_color='blue',size=15) - plot.circle('mlduration','mlpower',source=source, + plot.circle('mlduration','mlpower',source=sourceml, fill_color='green',size=15) - plot.circle('mhduration','mhpower',source=source, + plot.circle('mhduration','mhpower',source=sourcemh, fill_color='orange',size=15) plot.title.text = 'age '+str(age) @@ -3317,7 +3338,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data', powerdf = powerdf[~(powerdf == 0).any(axis=1)] # plot tools - if (promember==1): + if (promember==1): # pragma: no cover TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' else: TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' @@ -3348,7 +3369,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data', if type == 'water': p1 = [r.p0,r.p1,r.p2,r.p3] ratio = r.cpratio - elif type == 'erg' : + elif type == 'erg' : # pragma: no cover p1 = [r.ep0,r.ep1,r.ep2,r.ep3] ratio = r.ecpratio @@ -3371,7 +3392,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data', # fitting WC data to three parameter CP model - if len(wcdurations)>=4: + if len(wcdurations)>=4: # pragma: no cover fitfunc = lambda pars,x: pars[0]/(1+(x/pars[2])) + pars[1]/(1+(x/pars[3])) errfunc = lambda pars,x,y: fitfunc(pars,x)-y p1wc, success = optimize.leastsq(errfunc, p0[:], @@ -3379,7 +3400,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data', else: p1wc = None - if p1wc is not None and cpoverlay: + if p1wc is not None and cpoverlay: # pragma: no cover fitpowerwc = fitfunc(p1wc,fitt) fitpowerexcellent = 0.7*fitfunc(p1wc,fitt) fitpowergood = 0.6*fitfunc(p1wc,fitt) @@ -3400,16 +3421,23 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data', CPmax = ratio*fitpower, duration = fitt/60., ftime = ftime, - workout = workouts, +# workout = workouts, fitpowerwc = fitpowerwc, fitpowerexcellent = fitpowerexcellent, fitpowergood = fitpowergood, fitpowerfair = fitpowerfair, fitpoweraverage = fitpoweraverage, - url = urls, +# url = urls, ) ) + sourceannot= ColumnDataSource( + data = dict( + workout = workouts, + url = urls, + ) + ) + # making the plot plot = Figure(tools=TOOLS,x_axis_type=x_axis_type, plot_width=900, @@ -3480,7 +3508,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername="",r=None,cpfit='data', plot.line('duration','CPmax',source=sourcecomplex,legend_label="CP Model", color='red') - if p1wc is not None: + if p1wc is not None: # pragma: no cover plot.line('duration','fitpowerwc',source=sourcecomplex, legend_label="Gold Medal Standard", color='darkgoldenrod',line_dash='dotted') @@ -3516,7 +3544,7 @@ def interactive_agegroup_plot(df,distance=2000,duration=None, name = df['name'] season = df['season'] - if duration: + if duration: # pragma: no cover duration2 = int(duration/60.) plottitle = sex+' '+weightcategory+' %s min' % duration2 else: @@ -3544,13 +3572,20 @@ def interactive_agegroup_plot(df,distance=2000,duration=None, data = dict( age = age, power = power, - age2 = age2, - expo_vals = expo_vals, + #age2 = age2, + #expo_vals = expo_vals, season = season, name=name, ) ) + sourcefit = ColumnDataSource( + data = dict( + age2 = age2, + expo_vals = expo_vals, + ) + ) + TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' plot = Figure(tools=TOOLS,plot_width=900) @@ -3558,7 +3593,7 @@ def interactive_agegroup_plot(df,distance=2000,duration=None, plot.circle('age','power',source=source,fill_color='red',size=15, legend_label='World Record') - plot.line(age2,expo_vals) + plot.line('age2','expo_vals',source=sourcefit) plot.xaxis.axis_label = "Age" plot.yaxis.axis_label = "Concept2 power" plot.title.text = plottitle @@ -3584,7 +3619,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, # plot tools if (promember==1): TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' - else: + else: # pragma: no cover TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' @@ -3615,7 +3650,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, # fitting the data to Paul if len(thedistances)>=2: paulslope, paulintercept,r,p,stderr = linregress(np.log10(thedistances),p) - else: + else: # pragma: no cover paulslope = 5.0/np.log10(2.0) paulintercept = p[0]-paulslope*np.log10(thedistances[0]) @@ -3655,7 +3690,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, if len(wcdurations)>=4: p1wc, success = optimize.leastsq(errfunc, p0[:], args = (wcdurations,wcpower)) - else: + else: # pragma: no cover p1wc = None # fitting the data to three parameter CP model @@ -3663,15 +3698,20 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, success = 0 p1 = p0 if len(thesecs)>=4: - p1, success = optimize.leastsq(errfunc, p0[:], args = (thesecs,theavpower)) - else: + try: + p1, success = optimize.leastsq(errfunc, p0[:], args = (thesecs,theavpower)) + except (RuntimeError,RuntimeWarning): # pragma: no cover + factor = fitfunc(p0,thesecs.mean())/theavpower.mean() + p1 = [p0[0]/factor,p0[1]/factor,p0[2],p0[3]] + success = 0 + else: # pragma: no cover factor = fitfunc(p0,thesecs.mean())/theavpower.mean() p1 = [p0[0]/factor,p0[1]/factor,p0[2],p0[3]] success = 0 # Get stayer score - if success == 1: + if success == 1: # pragma: no cover power1min = fitfunc(p1,60.) power4min = fitfunc(p1,240.) power6min = fitfunc(p1,360.) @@ -3706,7 +3746,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, fitpowerfair = 0.5*fitfunc(p1wc,fitt) fitpoweraverage = 0.4*fitfunc(p1wc,fitt) - else: + else: # pragma: no cover fitpowerwc = 0*fitpower fitpowerexcellent = 0*fitpower fitpowergood = 0*fitpower @@ -3716,7 +3756,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, message = "" - if len(fitpower[fitpower<0]) > 0: + if len(fitpower[fitpower<0]) > 0: # pragma: no cover message = "CP model fit didn't give correct results" fitvelo = (fitpower/2.8)**(1./3.) @@ -3781,7 +3821,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, plot.xaxis.axis_label = "Duration (seconds)" plot.yaxis.axis_label = "Power (W)" - if stayerscore is not None: + if stayerscore is not None: # pragma: no cover plot.add_layout( Label(x=100,y=100,x_units='screen',y_units='screen', text='Stayer Score '+str(stayerscore)+'%', @@ -3800,7 +3840,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, cpdata = dataprep.fetchcperg(rower, theworkouts) - if cpdata.empty: + if cpdata.empty: # pragma: no cover message = 'Calculations are running in the background. Please refresh this page to see updated results' return ['','',paulslope,paulintercept,p1,message,p1wc] @@ -3894,7 +3934,7 @@ def interactive_windchart(id=0,promember=0): hrtr=r.tr,hran=r.an,ftp=r.ftp) rowdata = rdata(f1,rower=rr) - if rowdata == 0: + if rowdata == 0: # pragma: no cover return 0 try: @@ -3902,7 +3942,7 @@ def interactive_windchart(id=0,promember=0): except KeyError: return ['','No Data Found'] - try: + try: # pragma: no cover vwind = rowdata.df.loc[:,'vwind'] winddirection = rowdata.df.loc[:,'winddirection'] bearing = rowdata.df.loc[:,'bearing'] @@ -3933,7 +3973,7 @@ def interactive_windchart(id=0,promember=0): # plot tools if (promember==1): TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,crosshair' - else: + else: # pragma: no cover TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,crosshair' @@ -3987,7 +4027,7 @@ def interactive_streamchart(id=0,promember=0): hrtr=r.tr,hran=r.an,ftp=r.ftp) rowdata = rdata(f1,rower=rr) - if rowdata == 0: + if rowdata == 0: # pragma: no cover return "","No Valid Data Available" try: @@ -4006,7 +4046,7 @@ def interactive_streamchart(id=0,promember=0): # plot tools if (promember==1): TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,crosshair' - else: + else: # pragma: no cover TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,crosshair' @@ -4054,12 +4094,12 @@ def interactive_chart(id=0,promember=0,intervaldata = {}): try: spm = datadf['spm'] - except KeyError: + except KeyError: # pragma: no cover datadf['spm'] = 0 try: pace = datadf['pace'] - except KeyError: + except KeyError: # pragma: no cover datadf['pace'] = 0 source = ColumnDataSource( @@ -4175,7 +4215,7 @@ def interactive_chart(id=0,promember=0,intervaldata = {}): def interactive_chart_video(videodata): try: spm = videodata['spm'] - except KeyError: + except KeyError: # pragma: no cover return "","No SPM data" time = range(len(spm)) @@ -4288,22 +4328,22 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', title=None,binsize=1,colorlegend=[], spmmin=0,spmmax=0,workmin=0,workmax=0): - if datadf.empty: + if datadf.empty: # pragma: no cover return ['','

No non-zero data in selection

'] - if xparam == 'workoutid': + if xparam == 'workoutid': # pragma: no cover xparamname = 'Workout' else: xparamname = axlabels[xparam] - if yparam == 'workoutid': + if yparam == 'workoutid': # pragma: no cover yparamname = 'Workout' else: yparamname = axlabels[yparam] - if groupby == 'workoutid': + if groupby == 'workoutid': # pragma: no cover groupname = 'Workout' - elif groupby == 'date': + elif groupby == 'date': # pragma: no cover groupname = 'Date' else: groupname = axlabels[groupby] @@ -4316,31 +4356,31 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', gr = groupname, ) - if xparam == 'cumdist': + if xparam == 'cumdist': # pragma: no cover res = make_cumvalues(datadf[xparam]) datadf[xparam] = res[0] - if xparam=='distance': + if xparam=='distance': # pragma: no cover xaxmax = datadf[xparam].max() xaxmin = datadf[xparam].min() - elif xparam=='time': + elif xparam=='time': # pragma: no cover tseconds = datadf.loc[:,'time'] xaxmax = tseconds.max() xaxmin = 0 - elif xparam == 'workoutid': + elif xparam == 'workoutid': # pragma: no cover xaxmax = datadf[xparam].max()-5 xaxmin = datadf[xparam].min()+5 else: xaxmax = yaxmaxima[xparam] xaxmin = yaxminima[xparam] - if yparam=='distance': + if yparam=='distance':# pragma: no cover yaxmax = datadf[yparam].max() yaxmin = datadf[yparam].min() - elif yparam=='time': + elif yparam=='time': # pragma: no cover tseconds = datadf.loc[:,'time'] yaxmax = tseconds.max() yaxmin = 0 - elif yparam == 'workoutid': + elif yparam == 'workoutid': # pragma: no cover yaxmax = datadf[yparam].max()-5 yaxmin = datadf[yparam].min()+5 else: @@ -4349,7 +4389,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', x_axis_type = 'linear' y_axis_type = 'linear' - if xparam == 'time': + if xparam == 'time': # pragma: no cover x_axis_type = 'datetime' if yparam == 'pace': y_axis_type = 'datetime' @@ -4370,7 +4410,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', (xparamname,'@x{1.1}'), (yparamname,'@y') ]) - else: + else: # pragma: no cover hover = HoverTool(names=['data'], tooltips = [ (groupby,'@groupval'), @@ -4460,12 +4500,12 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', angle=90, angle_units='deg') - if xparam == 'workoutid': + if xparam == 'workoutid': # pragma: no cover plot.xaxis.axis_label = 'Workout' else: plot.xaxis.axis_label = axlabels[xparam] - if yparam == 'workoutid': + if yparam == 'workoutid': # pragma: no cover plot.xaxis.axis_label = 'Workout' else: plot.yaxis.axis_label = axlabels[yparam] @@ -4524,7 +4564,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, try: tests = datadf[yparam2] - except KeyError: + except KeyError: # pragma: no cover yparam2 = 'None' try: @@ -4558,19 +4598,19 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, # check if dataframe not empty - if datadf.empty: + if datadf.empty: # pragma: no cover return ['','

No non-zero data in selection

','',''] try: datadf['x1'] = datadf.loc[:,xparam] - except KeyError: + except KeyError: # pragma: no cover try: datadf['x1'] = datadf['distance'] except KeyError: try: datadf['x1'] = datadf['time'] - except KeyError: + except KeyError: # pragma: no cover return ['','

No non-zero data in selection

','',''] try: @@ -4578,18 +4618,18 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, except KeyError: try: datadf['y1'] = datadf['pace'] - except KeyError: + except KeyError: # pragma: no cover return ['','

No non-zero data in selection

','',''] if yparam2 != 'None': try: datadf['y2'] = datadf.loc[:,yparam2] - except KeyError: + except KeyError: # pragma: no cover datadf['y2'] = datadf['y1'] - else: + else: # pragma: no cover datadf['y2'] = datadf['y1'] - if xparam=='distance': + if xparam=='distance': # pragma: no cover xaxmax = datadf['x1'].max() xaxmin = datadf['x1'].min() else: @@ -4610,7 +4650,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, if xparam == 'time': x_axis_type = 'datetime' - if yparam1 == 'pace': + if yparam1 == 'pace': # pragma: no cover y_axis_type = 'datetime' y1mean = datadf.loc[:,'pace'].mean() @@ -4618,7 +4658,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, datadf['yname1'] = axlabels[yparam1] if yparam2 != 'None': datadf['yname2'] = axlabels[yparam2] - else: + else: # pragma: no cover datadf['yname2'] = axlabels[yparam1] @@ -4633,7 +4673,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, # Add hover to this comma-separated string and see what changes if (promember==1): TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,crosshair' - else: + else: # pragma: no cover TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,crosshair' plot = Figure(x_axis_type=x_axis_type,y_axis_type=y_axis_type, @@ -4720,7 +4760,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, xrange1 = Range1d(start=yaxminima[xparam],end=yaxmaxima[xparam]) plot.x_range = xrange1 - if yparam1 == 'pace': + if yparam1 == 'pace': # pragma: no cover plot.yaxis[0].formatter = DatetimeTickFormatter( seconds = ["%S"], minutes = ["%M"] @@ -4875,7 +4915,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, try: distmax = 100+100*int(datadf['distance'].max()/100.) - except KeyError: + except KeyError: # pragma: no cover distmax = 1000. slider_dist_min = Slider(width=140, start=0,end=distmax,value=0,step=50, @@ -4889,12 +4929,12 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, slider_dist_max.js_on_change('value',callback) callback.args["maxdist"] = slider_dist_max - slider_spm_min.sizing_mode = 'fixed' - slider_spm_max.sizing_mode = 'fixed' - slider_work_min.sizing_mode = 'fixed' - slider_work_max.sizing_mode = 'fixed' - slider_dist_min.sizing_mode = 'fixed' - slider_dist_max.sizing_mode = 'fixed' + #slider_spm_min.sizing_mode = 'fixed' + #slider_spm_max.sizing_mode = 'fixed' + #slider_work_min.sizing_mode = 'fixed' + #slider_work_max.sizing_mode = 'fixed' + #slider_dist_min.sizing_mode = 'fixed' + #slider_dist_max.sizing_mode = 'fixed' thesliders = layoutcolumn([slider_spm_min, slider_spm_max, @@ -4905,7 +4945,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, ], ) - thesliders.sizing_mode = 'fixed' + #thesliders.sizing_mode = 'fixed' layout = layoutrow([thesliders, plot]) @@ -4939,7 +4979,7 @@ def interactive_flexchart_stacked(id,r,xparam='time', workstrokesonly=False) - if r.usersmooth > 1: + if r.usersmooth > 1: # pragma: no cover for column in columns: try: if metricsdicts[column]['maysmooth']: @@ -4960,23 +5000,23 @@ def interactive_flexchart_stacked(id,r,xparam='time', try: tseconds = rowdata.loc[:,'time'] - except KeyError: + except KeyError: # pragma: no cover return '','No time data - cannot make flex plot','','',comment try: rowdata['x1'] = rowdata.loc[:,xparam] rowmin = rowdata[xparam].min() - except KeyError: + except KeyError: # pragma: no cover rowdata['x1'] = 0*rowdata.loc[:,'time'] try: rowdata['y1'] = rowdata.loc[:,yparam1] rowmin = rowdata[yparam1].min() - except KeyError: + except KeyError: # pragma: no cover rowdata['y1'] = 0*rowdata.loc[:,'time'] rowdata[yparam1] = rowdata['y1'] - try: + try: # pragma: no cover rowdata['y2'] = rowdata.loc[:,yparam2] rowmin = rowdata[yparam2].min() except KeyError: @@ -4986,24 +5026,24 @@ def interactive_flexchart_stacked(id,r,xparam='time', try: rowdata['y3'] = rowdata.loc[:,yparam3] rowmin = rowdata[yparam3].min() - except KeyError: + except KeyError: # pragma: no cover rowdata['y3'] = 0*rowdata.loc[:,'time'] rowdata[yparam3] = rowdata['y3'] try: rowdata['y4'] = rowdata.loc[:,yparam4] rowmin = rowdata[yparam4].min() - except KeyError: + except KeyError: # pragma: no cover rowdata['y4'] = 0*rowdata.loc[:,'time'] rowdata[yparam4] = rowdata['y4'] if xparam=='time': xaxmax = tseconds.max() xaxmin = tseconds.min() - elif xparam=='distance' or xparam=='cumdist': + elif xparam=='distance' or xparam=='cumdist': # pragma: no cover xaxmax = rowdata['x1'].max() xaxmin = rowdata['x1'].min() - else: + else: # pragma: no cover try: xaxmax = get_yaxmaxima(r,xparam,mode) xaxmin = get_yaxminima(r,xparam,mode) @@ -5020,41 +5060,41 @@ def interactive_flexchart_stacked(id,r,xparam='time', if xparam == 'time': x_axis_type = 'datetime' - if yparam1 == 'pace': + if yparam1 == 'pace': # pragma: no cover y1_axis_type = 'datetime' - if yparam2 == 'pace': + if yparam2 == 'pace': # pragma: no cover y2_axis_type = 'datetime' - if yparam3 == 'pace': + if yparam3 == 'pace': # pragma: no cover y3_axis_type = 'datetime' - if yparam4 == 'pace': + if yparam4 == 'pace': # pragma: no cover y4_axis_type = 'datetime' try: rowdata['xname'] = axlabels[xparam] - except KeyError: + except KeyError: # pragma: no cover rowdata['xname'] = xparam try: rowdata['yname1'] = axlabels[yparam1] - except KeyError: + except KeyError: # pragma: no cover rowdata['yname1'] = yparam1 try: rowdata['yname2'] = axlabels[yparam2] - except KeyError: + except KeyError: # pragma: no cover rowdata['yname2'] = yparam2 try: rowdata['yname3'] = axlabels[yparam3] - except KeyError: + except KeyError: # pragma: no cover rowdata['yname3'] = yparam3 try: rowdata['yname4'] = axlabels[yparam4] - except KeyError: + except KeyError: # pragma: no cover rowdata['yname4'] = yparam4 # prepare data @@ -5089,56 +5129,21 @@ def interactive_flexchart_stacked(id,r,xparam='time', plot3.add_tools(linked_crosshair) plot4.add_tools(linked_crosshair) - try: - xaxlabel = axlabels[xparam] - except KeyError: - xaxlabel = xparam - - try: - yax1label = axlabels[yparam1] - except KeyError: - yax1label = yparam1 + xaxlabel = axlabels.get(xparam,xparam) + yax1label = axlabels.get(yparam1,yparam1) plot1.yaxis.axis_label = yax1label - try: - xaxlabel = axlabels[xparam] - except KeyError: - xaxlabel = xparam - - try: - yax2label = axlabels[yparam2] - except KeyError: - yax2label = yparam2 + yax2label = axlabels.get(yparam2,yparam2) plot2.yaxis.axis_label = yax2label - try: - xaxlabel = axlabels[xparam] - except KeyError: - xaxlabel = xparam + yax3label = axlabels.get(yparam3,yparam3) - try: - yax3label = axlabels[yparam3] - except KeyError: - yax3label = yparam3 plot3.yaxis.axis_label = yax3label - try: - xaxlabel = axlabels[xparam] - except KeyError: - xaxlabel = xparam - - try: - yax4label = axlabels[yparam4] - except KeyError: - yax4label = yparam4 - - try: - xaxlabel = axlabels[xparam] - except KeyError: - xaxlabel = xparam + yax4label = axlabels.get(yparam4,yparam4) plot4.yaxis.axis_label = yax4label @@ -5168,49 +5173,49 @@ def interactive_flexchart_stacked(id,r,xparam='time', if yparam1 == 'pace': y1tooltip = '@fpace' - elif yparam1 != 'None': + elif yparam1 != 'None': # pragma: no cover y1tooltip = '@{yparam1}'.format(yparam1=yparam1) if metricsdicts[yparam1]['numtype'] == 'integer' or yparam1 == 'power': y1tooltip+='{int}' - else: + else: # pragma: no cover y1tooltip+='{0.00}' - else: + else: # pragma: no cover y1tooltip = '' comment = 'The metric in the first chart is only accessible with a Pro plan or higher' - if yparam2 == 'pace': + if yparam2 == 'pace': # pragma: no cover y2tooltip = '@fpace' elif yparam2 != 'None': y2tooltip = '@{yparam2}'.format(yparam2=yparam2) if metricsdicts[yparam2]['numtype'] == 'integer' or yparam2 == 'power': y2tooltip+='{int}' - else: + else: # pragma: no cover y2tooltip+='{0.00}' - else: + else: # pragma: no cover y2tooltip = '' comment = 'The metric in the second chart is only accessible with a Pro plan or higher' - if yparam3 == 'pace': + if yparam3 == 'pace': # pragma: no cover y3tooltip = '@fpace' elif yparam3 != 'None': y3tooltip = '@{yparam3}'.format(yparam3=yparam3) if metricsdicts[yparam3]['numtype'] == 'integer' or yparam3 == 'power': y3tooltip+='{int}' - else: + else: # pragma: no cover y3tooltip+='{0.00}' - else: + else: # pragma: no cover y3tooltip = '' comment = 'The metric in the third chart is only accessible with a Pro plan or higher' - if yparam4 == 'pace': + if yparam4 == 'pace': # pragma: no cover y4tooltip = '@fpace' elif yparam4 != 'None': y4tooltip = '@{yparam4}'.format(yparam4=yparam4) - if metricsdicts[yparam4]['numtype'] == 'integer' or yparam4 == 'power': + if metricsdicts[yparam4]['numtype'] == 'integer' or yparam4 == 'power': # pragma: no cover y4tooltip+='{int}' - else: + else: # pragma: no cover y4tooltip+='{0.00}' - else: + else: # pragma: no cover y4tooltip = '' comment = 'The metric in the fourth chart is only accessible with a Pro plan or higher' @@ -5280,7 +5285,7 @@ def interactive_flexchart_stacked(id,r,xparam='time', ) plot1.y_range = Range1d(y1min,y1max) - if yparam2 == 'pace': + if yparam2 == 'pace': # pragma: no cover plot2.yaxis[0].formatter = DatetimeTickFormatter( seconds = ["%S"], minutes = ["%M"] @@ -5288,14 +5293,14 @@ def interactive_flexchart_stacked(id,r,xparam='time', plot2.y_range = Range1d(y2min,y2max) - if yparam3 == 'pace': + if yparam3 == 'pace': # pragma: no cover plot3.yaxis[0].formatter = DatetimeTickFormatter( seconds = ["%S"], minutes = ["%M"] ) plot3.y_range = Range1d(y3min,y3max) - if yparam4 == 'pace': + if yparam4 == 'pace': # pragma: no cover plot4.yaxis[0].formatter = DatetimeTickFormatter( seconds = ["%S"], minutes = ["%M"] @@ -5354,7 +5359,7 @@ def interactive_flex_chart2(id,r,promember=0, rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True, workstrokesonly=workstrokesonly) - if r.usersmooth > 1: + if r.usersmooth > 1: # pragma: no cover for column in columns: try: if metricsdicts[column]['maysmooth']: @@ -5377,14 +5382,14 @@ def interactive_flex_chart2(id,r,promember=0, workstrokesonly=False try: tests = rowdata[yparam2] - except KeyError: + except KeyError: # pragma: no cover yparam2 = 'None' try: tests = rowdata[yparam1] - except KeyError: + except KeyError: # pragma: no cover yparam1 = 'None' @@ -5416,7 +5421,7 @@ def interactive_flex_chart2(id,r,promember=0, workoutstatesrest = [3] workoutstatetransition = [0,2,10,11,12,13] - if workstrokesonly: + if workstrokesonly: # pragma: no cover try: rowdata = rowdata[~rowdata['workoutstate'].isin(workoutstatesrest)] except KeyError: @@ -5424,20 +5429,20 @@ def interactive_flex_chart2(id,r,promember=0, try: tseconds = rowdata.loc[:,'time'] - except KeyError: + except KeyError: # pragma: no cover return '','No time data - cannot make flex plot','','',workstrokesonly try: rowdata['x1'] = rowdata.loc[:,xparam] rowmin = rowdata[xparam].min() - except KeyError: + except KeyError: # pragma: no cover rowdata['x1'] = 0*rowdata.loc[:,'time'] try: rowdata['y1'] = rowdata.loc[:,yparam1] rowmin = rowdata[yparam1].min() - except KeyError: + except KeyError: # pragma: no cover rowdata['y1'] = 0*rowdata.loc[:,'time'] rowdata[yparam1] = rowdata['y1'] @@ -5445,10 +5450,10 @@ def interactive_flex_chart2(id,r,promember=0, try: rowdata['y2'] = rowdata.loc[:,yparam2] rowmin = rowdata[yparam2].min() - except KeyError: + except KeyError: # pragma: no cover rowdata['y2'] = 0*rowdata.loc[:,'time'] rowdata[yparam2] = rowdata['y2'] - else: + else: # pragma: no cover rowdata['y2'] = rowdata['y1'] if xparam=='time': @@ -5457,7 +5462,7 @@ def interactive_flex_chart2(id,r,promember=0, elif xparam=='distance' or xparam=='cumdist': xaxmax = rowdata['x1'].max() xaxmin = rowdata['x1'].min() - else: + else: # pragma: no cover try: xaxmax = get_yaxmaxima(r,xparam,mode) xaxmin = get_yaxminima(r,xparam,mode) @@ -5469,9 +5474,9 @@ def interactive_flex_chart2(id,r,promember=0, if xparam != 'time': try: x1mean = rowdata['x1'].mean() - except TypeError: + except TypeError: # pragma: no cover x1mean = 0 - else: + else: # pragma: no cover x1mean = 0 y1mean = rowdata['y1'].mean() @@ -5484,7 +5489,7 @@ def interactive_flex_chart2(id,r,promember=0, # constant power plot if yparam1 == 'driveenergy': - if xparam == 'spm': + if xparam == 'spm': # pragma: no cover yconstantpower = rowdata['y1'].mean()*rowdata['x1'].mean()/xvals x_axis_type = 'linear' @@ -5496,23 +5501,23 @@ def interactive_flex_chart2(id,r,promember=0, y_axis_type = 'datetime' try: y1mean = rowdata.loc[:,'pace'].mean() - except KeyError: + except KeyError: # pragma: no cover y1mean = 0 try: rowdata['xname'] = axlabels[xparam] - except KeyError: + except KeyError: # pragma: no cover rowdata['xname'] = xparam try: rowdata['yname1'] = axlabels[yparam1] - except KeyError: + except KeyError: # pragma: no cover rowdata['yname1'] = yparam1 if yparam2 != 'None': try: rowdata['yname2'] = axlabels[yparam2] - except KeyError: + except KeyError: # pragma: no cover rowdata['yname2'] = yparam2 - else: + else: # pragma: no cover rowdata['yname2'] = rowdata['yname1'] @@ -5582,7 +5587,7 @@ def interactive_flex_chart2(id,r,promember=0, xlabeltext = axlabels[xparam]+": {x1mean:6.2f}".format( x1mean=x1mean ) - except KeyError: + except KeyError: # pragma: no cover xlabeltext = xparam+": {x1mean:6.2f}".format(x1mean=x1mean) xlabel = Label(x=50,y=80,x_units='screen',y_units='screen', @@ -5607,7 +5612,7 @@ def interactive_flex_chart2(id,r,promember=0, ) - if (xparam != 'time') and (xparam != 'distance') and (xparam != 'cumdist'): + if (xparam != 'time') and (xparam != 'distance') and (xparam != 'cumdist'): # pragma: no cover plot.add_layout(x1means) plot.add_layout(xlabel) @@ -5618,12 +5623,12 @@ def interactive_flex_chart2(id,r,promember=0, try: yaxlabel = axlabels[yparam1] - except KeyError: + except KeyError: # pragma: no cover yaxlabel = str(yparam1)+' ' try: xaxlabel = axlabels[xparam] - except KeyError: + except KeyError: # pragma: no cover xaxlabel = xparam y1label = Label(x=50,y=50,x_units='screen',y_units='screen', @@ -5632,18 +5637,18 @@ def interactive_flex_chart2(id,r,promember=0, background_fill_color='white', text_color='blue', ) - if yparam1 != 'time' and yparam1 != 'pace': + if yparam1 != 'time' and yparam1 != 'pace': # pragma: no cover plot.add_layout(y1label) y2label = y1label # average values - if yparam1 == 'driveenergy': + if yparam1 == 'driveenergy': # pragma: no cover if xparam == 'spm': plot.line(xvals,yconstantpower,color="green",legend_label="Constant Power") if plottype=='line': plot.line('x1','y1',source=source2,legend_label=yaxlabel) - elif plottype=='scatter': + elif plottype=='scatter': # pragma: no cover plot.scatter('x1','y1',source=source2,legend_label=yaxlabel,fill_alpha=0.4, line_color=None) @@ -5660,13 +5665,13 @@ def interactive_flex_chart2(id,r,promember=0, try: yrange1 = Range1d(start=get_yaxminima(r,yparam1,mode), end=get_yaxmaxima(r,yparam1,mode)) - except KeyError: + except KeyError: # pragma: no cover yrange1 = Range1d(start=rowdata[yparam1].min(), end=rowdata[yparam1].max()) plot.y_range = yrange1 - if (xparam != 'time') and (xparam != 'distance') and (xparam != 'cumdist'): + if (xparam != 'time') and (xparam != 'distance') and (xparam != 'cumdist'): # pragma: no cover try: xrange1 = Range1d(start=get_yaxminima(r,xparam,mode), end=get_yaxmaxima(r,xparam,mode)) @@ -5700,7 +5705,7 @@ def interactive_flex_chart2(id,r,promember=0, try: yrange2 = Range1d(start=get_yaxminima(r,yparam2,mode), end=get_yaxmaxima(r,yparam2,mode)) - except KeyError: + except KeyError: # pragma: no cover yrange2 = Range1d(start=rowdata[yparam2].min(), end=rowdata[yparam2].max()) @@ -5708,7 +5713,7 @@ def interactive_flex_chart2(id,r,promember=0, #= {"yax2": yrange2} try: axlegend = axlabels[yparam2] - except KeyError: + except KeyError: # pragma: no cover axlegend = str(yparam2)+' ' if plottype=='line': @@ -5716,7 +5721,7 @@ def interactive_flex_chart2(id,r,promember=0, legend_label=axlegend, source=source2) - elif plottype=='scatter': + elif plottype=='scatter': # pragma: no cover plot.scatter('x1','y2',source=source2,legend_label=axlegend, fill_alpha=0.4, line_color=None,color="red",y_range_name="yax2") @@ -5903,7 +5908,7 @@ def interactive_flex_chart2(id,r,promember=0, try: distmax = 100+100*int(rowdata['distance'].max()/100.) - except (KeyError,ValueError): + except (KeyError,ValueError): # pragma: no cover distmax = 100 slider_dist_min = Slider(width=140, start=0,end=distmax,value=0,step=50, @@ -5917,13 +5922,13 @@ def interactive_flex_chart2(id,r,promember=0, slider_dist_max.js_on_change('value',callback) callback.args["maxdist"] = slider_dist_max - annotation.sizing_mode = 'fixed' - slider_spm_min.sizing_mode = 'fixed' - slider_spm_max.sizing_mode = 'fixed' - slider_work_min.sizing_mode = 'fixed' - slider_work_max.sizing_mode = 'fixed' - slider_dist_min.sizing_mode = 'fixed' - slider_dist_max.sizing_mode = 'fixed' + #annotation.sizing_mode = 'fixed' + #slider_spm_min.sizing_mode = 'fixed' + #slider_spm_max.sizing_mode = 'fixed' + #slider_work_min.sizing_mode = 'fixed' + #slider_work_max.sizing_mode = 'fixed' + #slider_dist_min.sizing_mode = 'fixed' + #slider_dist_max.sizing_mode = 'fixed' thesliders = layoutcolumn([ annotation, @@ -5935,7 +5940,7 @@ def interactive_flex_chart2(id,r,promember=0, slider_work_max, ]) - thesliders.sizing_mode = 'fixed' + #thesliders.sizing_mode = 'fixed' layout = layoutrow([thesliders, plot]) @@ -5965,7 +5970,7 @@ def thumbnails_set(r,id,favorites): try: rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=False, workstrokesonly=False) - except: + except: # pragma: no cover return [ {'script':"", 'div':"", @@ -5992,7 +5997,7 @@ def thumbnails_set(r,id,favorites): bins = np.linspace(rowdata['time'].min(),rowdata['time'].max(),maxlength) groups = rowdata.groupby(np.digitize(rowdata['time'],bins)) rowdata = groups.mean() - except KeyError: + except KeyError: # pragma: no cover pass for f in favorites: @@ -6037,24 +6042,24 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0, try: tseconds = rowdata.loc[:,'time'] - except KeyError: + except KeyError: # pragma: no cover return '','No time data - cannot make flex plot' try: rowdata['x1'] = rowdata.loc[:,xparam] - except KeyError: + except KeyError: # pragma: no cover rowdata['x1'] = 0*rowdata.loc[:,'time'] try: rowdata['y1'] = rowdata.loc[:,yparam1] - except KeyError: + except KeyError: # pragma: no cover rowdata['y1'] = 0*rowdata.loc[:,'time'] if yparam2 != 'None': try: rowdata['y2'] = rowdata.loc[:,yparam2] - except KeyError: + except KeyError: # pragma: no cover rowdata['y2'] = 0*rowdata.loc[:,'time'] else: rowdata['y2'] = rowdata['y1'] @@ -6062,7 +6067,7 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0, if xparam=='time': xaxmax = tseconds.max() xaxmin = tseconds.min() - elif xparam=='distance' or xparam=='cumdist': + elif xparam=='distance' or xparam=='cumdist': # pragma: no cover xaxmax = rowdata['x1'].max() xaxmin = rowdata['x1'].min() else: @@ -6074,7 +6079,7 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0, if xparam == 'time': x_axis_type = 'datetime' - if yparam1 == 'pace': + if yparam1 == 'pace': # pragma: no cover y_axis_type = 'datetime' y1mean = rowdata.loc[:,'pace'].mean() @@ -6082,7 +6087,7 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0, rowdata['xname'] = axlabels[xparam] try: rowdata['yname1'] = axlabels[yparam1] - except KeyError: + except KeyError: # pragma: no cover rowdata['yname1'] = axlabels[xparam] if yparam2 != 'None': rowdata['yname2'] = axlabels[yparam2] @@ -6121,17 +6126,17 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0, try: plot.xaxis.axis_label = axlabels[xparam] - except KeyError: + except KeyError: # pragma: no cover plot.xaxis.axis_label = 'X' try: plot.yaxis.axis_label = axlabels[yparam1] - except KeyError: + except KeyError: # pragma: no cover plot.yaxis.axis_label = 'Y' try: yrange1 = Range1d(start=yaxminima[yparam1],end=yaxmaxima[yparam1]) - except KeyError: + except KeyError: # pragma: no cover yrange1 = Range1d(start=yparam1.min(), end=yparam1.max()) plot.y_range = yrange1 @@ -6153,7 +6158,7 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0, ) - if yparam1 == 'pace': + if yparam1 == 'pace': # pragma: no cover plot.yaxis[0].formatter = DatetimeTickFormatter( seconds = ["%S"], minutes = ["%M"] @@ -6169,7 +6174,7 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0, plot.line('x1','y2',color="red",y_range_name="yax2", source=source) - elif plottype=='scatter': + elif plottype=='scatter': # pragma: no cover plot.scatter('x1','y2',source=source, fill_alpha=0.4, line_color=None,color="red",y_range_name="yax2") @@ -6186,128 +6191,6 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0, return [script,div] - -def interactive_bar_chart(id=0,promember=0): - # check if valid ID exists (workout exists) - rowdata,row = dataprep.getrowdata_db(id=id) - rowdata.dropna(axis=1,how='all',inplace=True) - rowdata.dropna(axis=0,how='any',inplace=True) - - if rowdata.empty: - return "","No Valid Data Available" - - # Add hover to this comma-separated string and see what changes - if (promember==1): - TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' - else: - TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' - - source = ColumnDataSource( - rowdata - ) - - plot = Figure(x_axis_type="datetime",y_axis_type="datetime", - toolbar_sticky=False, - plot_width=920, - tools=TOOLS) - - # add watermark - watermarkurl = "/static/img/logo7.png" - watermarksource = ColumnDataSource(dict( - url = [watermarkurl],)) - - watermarkrange = Range1d(start=0,end=1) - watermarkalpha = 0.6 - watermarkx = 0.99 - watermarky = 0.01 - watermarkw = 184 - watermarkh = 35 - watermarkanchor = 'bottom_right' - plot.extra_y_ranges = {"watermark": watermarkrange} - plot.extra_x_ranges = {"watermark": watermarkrange} - plot.sizing_mode = 'stretch_both' - - plot.image_url([watermarkurl],0.01,0.99, - watermarkw,watermarkh, - global_alpha=watermarkalpha, - w_units='screen', - h_units='screen', - anchor='top_left', - dilate=True, - x_range_name = "watermark", - y_range_name = "watermark", - ) - - plot.title.text = row.name - plot.title.text_font_size=value("1.0em") - plot.xaxis.axis_label = "Time" - plot.yaxis.axis_label = "Pace (/500m)" - plot.xaxis[0].formatter = DatetimeTickFormatter( - hours ="", - minutes = ["%M"], - seconds = ["%S"], - days = ["0"], - months = [""], - years = [""] - ) - - plot.yaxis[0].formatter = DatetimeTickFormatter( - hours = "", - seconds = ["%S"], - minutes = ["%M"], - ) - ymax = 1.0e3*90 - ymin = 1.0e3*180 - - if row.workouttype == 'water': - ymax = 1.0e3*90 - ymin = 1.0e3*210 - - plot.y_range = Range1d(ymin,ymax) - - - hover = plot.select(dict(type=HoverTool)) - - - hover.tooltips = OrderedDict([ - ('Time','@ftime'), - ('Pace','@fpace'), - ('HR','@hr{int}'), - ('SPM','@spm{1.1}'), - ]) - - hover.mode = 'mouse' - - plot.extra_y_ranges["hr"] = Range1d(start=100,end=200) - plot.quad(left='time',top='hr_ut2',bottom='hr_bottom', - right='x_right',source=source,color="gray", - y_range_name="hr", legend_label=" 0] # check if dataframe not empty - if datadf.empty: + if datadf.empty: # pragma: no cover return ['','

No non-zero data in selection

','','No non-zero data in selection'] - if xparam != 'distance' and xparam != 'time' and xparam != 'cumdist': + if xparam != 'distance' and xparam != 'time' and xparam != 'cumdist': # pragma: no cover xaxmax = yaxmaxima[xparam] xaxmin = yaxminima[xparam] elif xparam == 'time' and not startenddict: xaxmax = tseconds.max() xaxmin = tseconds.min() - elif xparam == 'time' and startenddict: + elif xparam == 'time' and startenddict: # pragma: no cover deltas = [pair[1]-pair[0] for key,pair in startenddict.items()] xaxmin = 0 xaxmax = pd.Series(deltas).max()*1000. @@ -6368,10 +6251,10 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', xaxmax = datadf['distance'].max() xaxmin = datadf['distance'].min() - if yparam == 'distance': + if yparam == 'distance': # pragma: no cover yaxmin = datadf['distance'].min() yaxmax = datadf['distance'].max() - elif yparam == 'cumdist': + elif yparam == 'cumdist': # pragma: no cover yaxmin = datadf['cumdist'].min() yaxmax = datadf['cumdist'].max() else: @@ -6384,7 +6267,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', # Add hover to this comma-separated string and see what changes if (promember==1): TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,crosshair' - else: + else: # pragma: no cover TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,crosshair' if yparam == 'pace': @@ -6471,7 +6354,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', try: group['x'] = group[xparam] - except KeyError: + except KeyError: # pragma: no cover group['x'] = group['time'] errormessage = xparam+' has no values. Plot invalid' try: @@ -6490,7 +6373,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', if windowsize > 3 and windowsize < len(group['y']): try: group['y'] = savgol_filter(group['y'],windowsize,3) - except ValueError: + except ValueError: # pragma: no cover pass ylabel = Label(x=100,y=60+nrworkouts*20-20*cntr, @@ -6521,9 +6404,9 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', if labeldict: try: legend_label=labeldict[id] - except KeyError: + except KeyError: # pragma: no cover legend = str(id) - else: + else: # pragma: no cover legend_label=str(id) if plottype=='line': @@ -6539,7 +6422,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', plot.xaxis.axis_label = axlabels[xparam] plot.yaxis.axis_label = axlabels[yparam] - if (xparam != 'time') and (xparam != 'distance') and (xparam != 'cumdist'): + if (xparam != 'time') and (xparam != 'distance') and (xparam != 'cumdist'): # pragma: no cover xrange1 = Range1d(start=yaxminima[xparam],end=yaxmaxima[xparam]) plot.x_range = xrange1 @@ -6584,7 +6467,7 @@ def interactive_otw_advanced_pace_chart(id=0,promember=0): # Add hover to this comma-separated string and see what changes if (promember==1): TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' - else: + else: # pragma: no cover TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' source = ColumnDataSource( @@ -6668,7 +6551,7 @@ def interactive_otw_advanced_pace_chart(id=0,promember=0): try: script, div = components(plot) - except: + except: # pragma: no cover script = '' div = '' diff --git a/rowers/nkstuff.py b/rowers/nkstuff.py index 4a3dbe2d..b23887f6 100644 --- a/rowers/nkstuff.py +++ b/rowers/nkstuff.py @@ -210,7 +210,7 @@ def rower_nk_token_refresh(user): def make_authorization_url(request): return imports_make_authorization_url(oauth_data) -def get_nk_workout_list(user,fake=False,startTime=0,endTime=0): +def get_nk_workout_list(user,fake=False,after=0,before=0): r = Rower.objects.get(user=user) if (r.nktoken == '') or (r.nktoken is None): @@ -221,12 +221,12 @@ def get_nk_workout_list(user,fake=False,startTime=0,endTime=0): return custom_exception_handler(401,s) else: # ready to fetch. Hurray - if not endTime: - endTime = int(arrow.now().timestamp())*1000 - endTime = str(endTime) - if not startTime: - startTime = arrow.now()-timedelta(days=30) - startTime = str(int(startTime.timestamp())*1000) + if not before: + before = arrow.now()+timedelta(days=1) + before = str(int(before.timestamp())*1000) + if not after: + after = arrow.now()-timedelta(days=30) + after = str(int(after.timestamp())*1000) authorizationstring = str('Bearer ' + r.nktoken) headers = {'Authorization': authorizationstring, 'user-agent': 'sanderroosendaal', @@ -236,8 +236,8 @@ def get_nk_workout_list(user,fake=False,startTime=0,endTime=0): url = NK_API_LOCATION+"api/v1/sessions" params = { - 'startTime':startTime, - 'endTime':endTime, + 'after':after, + 'before':before, } # start / end time s = requests.get(url,headers=headers,params=params) @@ -260,6 +260,7 @@ def get_workout(user,nkid): 'sessionIds': nkid, } + authorizationstring = str('Bearer ' + r.nktoken) headers = {'Authorization': authorizationstring, 'user-agent': 'sanderroosendaal', @@ -270,7 +271,6 @@ def get_workout(user,nkid): url = NK_API_LOCATION+"api/v1/sessions/strokes" response = requests.get(url,headers=headers,params=params) - if response.status_code != 200: # error handling and logging return {},pd.DataFrame() @@ -287,8 +287,8 @@ def get_workout(user,nkid): url = NK_API_LOCATION+"api/v1/sessions/" params = { - 'startTime':timestampbegin-1, - 'endTime': timestampend+1, + 'after':timestampbegin-1, + 'before': timestampend+1, } response = requests.get(url, headers=headers,params=params) @@ -303,4 +303,5 @@ def get_workout(user,nkid): if str(w['id']) == str(nkid): workoutdata = w + return workoutdata, df diff --git a/rowers/tasks.py b/rowers/tasks.py index c9dab841..fe6bd1ec 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -2040,12 +2040,12 @@ def handle_otwsetpower(self,f1, boattype, boatclass, coastalbrand, weightvalue, # do something with boat type try: - rowdata = rdata(csvfile) + rowdata = rdata(csvfile=csvfile) except IOError: try: - rowdata = rdata(csvfile) + rowdata = rdata(csvfile=csvfile) except IOError: - rowdata = rdata(csvfile) + rowdata = rdata(csvfile=csvfile) # do calculation, but do not overwrite NK Empower Power data powermeasured = False @@ -2097,12 +2097,12 @@ def handle_otwsetpower(self,f1, boattype, boatclass, coastalbrand, weightvalue, return 0 # do something with boat type try: - rowdata = rdata(csvfile) + rowdata = rdata(csvfile=csvfile) except IOError: try: - rowdata = rdata(csvfile) + rowdata = rdata(csvfile=csvfile) except IOError: - rowdata = rdata(csvfile) + rowdata = rdata(csvfile=csvfile) update_strokedata(workoutid, rowdata.df, debug=debug) @@ -2205,6 +2205,7 @@ def cp_from_workoutids(workoutids,debug=False): if len(data)>1: df = pd.concat(data,axis=0) + df = df[df['cp'] == df.groupby(['delta'])['cp'].transform('max')] df = df.sort_values(['delta']).reset_index() @@ -2250,6 +2251,7 @@ def cp_from_workoutids(workoutids,debug=False): power2k = fitfunc(p1,t3) + return powerfourmin,power2k,powerhour @@ -2818,6 +2820,7 @@ def handle_setcp(strokesdf,filename,workoutid,debug=False,**kwargs): except FileNotFoundError: pass if not strokesdf.empty: + try: totaltime = strokesdf['time'].max() except KeyError: @@ -2827,6 +2830,7 @@ def handle_setcp(strokesdf,filename,workoutid,debug=False,**kwargs): except KeyError: powermean = 0 + if powermean != 0: thesecs = totaltime maxt = 1.05 * thesecs diff --git a/rowers/templates/add_instantplan.html b/rowers/templates/add_instantplan.html index 4fb4e298..7617ab23 100644 --- a/rowers/templates/add_instantplan.html +++ b/rowers/templates/add_instantplan.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Add Instant Plan{% endblock %} diff --git a/rowers/templates/add_result.html b/rowers/templates/add_result.html index d0fa8aa7..45082bec 100644 --- a/rowers/templates/add_result.html +++ b/rowers/templates/add_result.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load staticfiles %} +{% load static %} {% block title %}Here's your result{% endblock %} diff --git a/rowers/templates/agegroupchart.html b/rowers/templates/agegroupchart.html index e7e499db..6d4d01df 100644 --- a/rowers/templates/agegroupchart.html +++ b/rowers/templates/agegroupchart.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Age Group Records{% endblock %} diff --git a/rowers/templates/agegroupcp.html b/rowers/templates/agegroupcp.html index 253eff4f..2308f5fb 100644 --- a/rowers/templates/agegroupcp.html +++ b/rowers/templates/agegroupcp.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Age Group CP{% endblock %} diff --git a/rowers/templates/alert_create.html b/rowers/templates/alert_create.html index d2d5da48..9940fa8e 100644 --- a/rowers/templates/alert_create.html +++ b/rowers/templates/alert_create.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% block title %}Metric Alert{% endblock %} diff --git a/rowers/templates/alert_delete_confirm.html b/rowers/templates/alert_delete_confirm.html index dc9a5417..8871a27d 100644 --- a/rowers/templates/alert_delete_confirm.html +++ b/rowers/templates/alert_delete_confirm.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% block title %}Planned Session{% endblock %} diff --git a/rowers/templates/alert_edit.html b/rowers/templates/alert_edit.html index 7849f3b4..04f92ce2 100644 --- a/rowers/templates/alert_edit.html +++ b/rowers/templates/alert_edit.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% block title %}Metric Alert{% endblock %} diff --git a/rowers/templates/alert_stats.html b/rowers/templates/alert_stats.html index 94cb4294..22d0492e 100644 --- a/rowers/templates/alert_stats.html +++ b/rowers/templates/alert_stats.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Metric Alert{% endblock %} diff --git a/rowers/templates/alerts.html b/rowers/templates/alerts.html index 1ac3b2dc..b6830a63 100644 --- a/rowers/templates/alerts.html +++ b/rowers/templates/alerts.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall - Analysis {% endblock %} diff --git a/rowers/templates/analysis.html b/rowers/templates/analysis.html index 68579114..d77796f8 100644 --- a/rowers/templates/analysis.html +++ b/rowers/templates/analysis.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall - Analysis {% endblock %} diff --git a/rowers/templates/async_tasks.html b/rowers/templates/async_tasks.html index 83c916f0..524f621a 100644 --- a/rowers/templates/async_tasks.html +++ b/rowers/templates/async_tasks.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall - Tasks {% endblock %} diff --git a/rowers/templates/boxplot.html b/rowers/templates/boxplot.html index e5574916..7f8bd9db 100644 --- a/rowers/templates/boxplot.html +++ b/rowers/templates/boxplot.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Box Plot {% endblock %} diff --git a/rowers/templates/c2_list_import.html b/rowers/templates/c2_list_import.html index 69a81cc7..e8015401 100644 --- a/rowers/templates/c2_list_import.html +++ b/rowers/templates/c2_list_import.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Workouts{% endblock %} diff --git a/rowers/templates/c2_list_import2.html b/rowers/templates/c2_list_import2.html index 5e1ffa68..42bae8e7 100644 --- a/rowers/templates/c2_list_import2.html +++ b/rowers/templates/c2_list_import2.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Workouts{% endblock %} diff --git a/rowers/templates/cn_form.html b/rowers/templates/cn_form.html index 5a32d235..5523eb51 100644 --- a/rowers/templates/cn_form.html +++ b/rowers/templates/cn_form.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% block title %}CrewNerd Summary loading{% endblock %} diff --git a/rowers/templates/comparison_list.html b/rowers/templates/comparison_list.html index 804fd6b9..354257d0 100644 --- a/rowers/templates/comparison_list.html +++ b/rowers/templates/comparison_list.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Workouts{% endblock %} diff --git a/rowers/templates/course_edit_view.html b/rowers/templates/course_edit_view.html index 797a2924..58b2cb64 100644 --- a/rowers/templates/course_edit_view.html +++ b/rowers/templates/course_edit_view.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load leaflet_tags %} diff --git a/rowers/templates/course_form.html b/rowers/templates/course_form.html index 1c5b25b6..f5d92337 100644 --- a/rowers/templates/course_form.html +++ b/rowers/templates/course_form.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}File loading{% endblock %} diff --git a/rowers/templates/course_form_update.html b/rowers/templates/course_form_update.html index 7a5dca80..7ba554cc 100644 --- a/rowers/templates/course_form_update.html +++ b/rowers/templates/course_form_update.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}File loading{% endblock %} diff --git a/rowers/templates/course_replace.html b/rowers/templates/course_replace.html index 17ad92c4..53569c1f 100644 --- a/rowers/templates/course_replace.html +++ b/rowers/templates/course_replace.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load leaflet_tags %} diff --git a/rowers/templates/course_replace_confirm.html b/rowers/templates/course_replace_confirm.html index b0b010c4..965b9180 100644 --- a/rowers/templates/course_replace_confirm.html +++ b/rowers/templates/course_replace_confirm.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load leaflet_tags %} diff --git a/rowers/templates/course_view.html b/rowers/templates/course_view.html index b7c9da70..06c3a1ec 100644 --- a/rowers/templates/course_view.html +++ b/rowers/templates/course_view.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load leaflet_tags %} diff --git a/rowers/templates/coursemap.html b/rowers/templates/coursemap.html index b5b162e6..d926f731 100644 --- a/rowers/templates/coursemap.html +++ b/rowers/templates/coursemap.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load leaflet_tags %} diff --git a/rowers/templates/cum_flex.html b/rowers/templates/cum_flex.html index c718372e..e78b002f 100644 --- a/rowers/templates/cum_flex.html +++ b/rowers/templates/cum_flex.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall {% endblock %} diff --git a/rowers/templates/cumstats.html b/rowers/templates/cumstats.html index 7841874a..7e5c5b83 100644 --- a/rowers/templates/cumstats.html +++ b/rowers/templates/cumstats.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall {% endblock %} diff --git a/rowers/templates/dashboard.html b/rowers/templates/dashboard.html index 1d3d0829..bfa4930d 100644 --- a/rowers/templates/dashboard.html +++ b/rowers/templates/dashboard.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} diff --git a/rowers/templates/disqualification_view.html b/rowers/templates/disqualification_view.html index bd1894b7..e0a984ee 100644 --- a/rowers/templates/disqualification_view.html +++ b/rowers/templates/disqualification_view.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block scripts %} {% include "monitorjobs.html" %} diff --git a/rowers/templates/document_form.html b/rowers/templates/document_form.html index b5dd35ba..2a6befb5 100644 --- a/rowers/templates/document_form.html +++ b/rowers/templates/document_form.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}File loading{% endblock %} diff --git a/rowers/templates/dropathleteconfirm.html b/rowers/templates/dropathleteconfirm.html index 73077b69..2e85294a 100644 --- a/rowers/templates/dropathleteconfirm.html +++ b/rowers/templates/dropathleteconfirm.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Remove Athlete {% endblock %} diff --git a/rowers/templates/dropcoachconfirm.html b/rowers/templates/dropcoachconfirm.html index 863c0e2c..b582aabb 100644 --- a/rowers/templates/dropcoachconfirm.html +++ b/rowers/templates/dropcoachconfirm.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Remove Coach {% endblock %} diff --git a/rowers/templates/embedded_video.html b/rowers/templates/embedded_video.html index 5543733b..0ff08fbe 100644 --- a/rowers/templates/embedded_video.html +++ b/rowers/templates/embedded_video.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load i18n %} {% load leaflet_tags %} diff --git a/rowers/templates/embedded_video_mini.html b/rowers/templates/embedded_video_mini.html index 20288285..db87e5ce 100644 --- a/rowers/templates/embedded_video_mini.html +++ b/rowers/templates/embedded_video_mini.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load i18n %} {% load leaflet_tags %} diff --git a/rowers/templates/empower_fix.html b/rowers/templates/empower_fix.html index 5fd1101e..9fbc66c3 100644 --- a/rowers/templates/empower_fix.html +++ b/rowers/templates/empower_fix.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Empower FIX{% endblock %} diff --git a/rowers/templates/entryedit.html b/rowers/templates/entryedit.html index fc1d5848..5adbce18 100644 --- a/rowers/templates/entryedit.html +++ b/rowers/templates/entryedit.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Register for a Virtual Race{% endblock %} diff --git a/rowers/templates/export.html b/rowers/templates/export.html index 59c952e5..e28275c0 100644 --- a/rowers/templates/export.html +++ b/rowers/templates/export.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Export {% endblock %} diff --git a/rowers/templates/export_workouts.html b/rowers/templates/export_workouts.html index b45dc2f5..0addb835 100644 --- a/rowers/templates/export_workouts.html +++ b/rowers/templates/export_workouts.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Workouts Summary Export{% endblock %} diff --git a/rowers/templates/failed_jobs.html b/rowers/templates/failed_jobs.html index 42080a36..526fa5f3 100644 --- a/rowers/templates/failed_jobs.html +++ b/rowers/templates/failed_jobs.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Failed Que{% endblock %} diff --git a/rowers/templates/fastestvirtualeventcreate.html b/rowers/templates/fastestvirtualeventcreate.html index 7034c3f3..00eb120f 100644 --- a/rowers/templates/fastestvirtualeventcreate.html +++ b/rowers/templates/fastestvirtualeventcreate.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}New Virtual Challenge{% endblock %} diff --git a/rowers/templates/fitnessfit.html b/rowers/templates/fitnessfit.html index 8c15d925..010f8e09 100644 --- a/rowers/templates/fitnessfit.html +++ b/rowers/templates/fitnessfit.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Fitness Progress {% endblock %} diff --git a/rowers/templates/fitnessmetric.html b/rowers/templates/fitnessmetric.html index 647f49be..c3a0a4d6 100644 --- a/rowers/templates/fitnessmetric.html +++ b/rowers/templates/fitnessmetric.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Fitness Progress {% endblock %} diff --git a/rowers/templates/flexchart3otw.html b/rowers/templates/flexchart3otw.html index d7fdf3af..bbae4c43 100644 --- a/rowers/templates/flexchart3otw.html +++ b/rowers/templates/flexchart3otw.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load tz %} diff --git a/rowers/templates/flexchartstacked.html b/rowers/templates/flexchartstacked.html index 665453ac..d44b9c33 100644 --- a/rowers/templates/flexchartstacked.html +++ b/rowers/templates/flexchartstacked.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load tz %} diff --git a/rowers/templates/followerform.html b/rowers/templates/followerform.html index 15b2231c..c64e5abc 100644 --- a/rowers/templates/followerform.html +++ b/rowers/templates/followerform.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load tz %} diff --git a/rowers/templates/forcecurve_single.html b/rowers/templates/forcecurve_single.html index ed7f9c5a..547b2bc5 100644 --- a/rowers/templates/forcecurve_single.html +++ b/rowers/templates/forcecurve_single.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load tz %} diff --git a/rowers/templates/freecoach_registration_form.html b/rowers/templates/freecoach_registration_form.html index a1746819..737ee4dc 100644 --- a/rowers/templates/freecoach_registration_form.html +++ b/rowers/templates/freecoach_registration_form.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}New Coach Registration{% endblock title %} {% block meta %} diff --git a/rowers/templates/frontpage.html b/rowers/templates/frontpage.html index dcd397c2..52f3a7c9 100644 --- a/rowers/templates/frontpage.html +++ b/rowers/templates/frontpage.html @@ -1,5 +1,5 @@ {% extends "newbasefront.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Rowing Data{% endblock %} diff --git a/rowers/templates/frontpageblogs.html b/rowers/templates/frontpageblogs.html index dd65e3ff..bc0e9eea 100644 --- a/rowers/templates/frontpageblogs.html +++ b/rowers/templates/frontpageblogs.html @@ -1,4 +1,4 @@ -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% for blog in blogposts %} diff --git a/rowers/templates/fusion.html b/rowers/templates/fusion.html index 89a11a4b..d5185cf8 100644 --- a/rowers/templates/fusion.html +++ b/rowers/templates/fusion.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Workouts{% endblock %} diff --git a/rowers/templates/fusion_list.html b/rowers/templates/fusion_list.html index a1d1d497..84cb64d5 100644 --- a/rowers/templates/fusion_list.html +++ b/rowers/templates/fusion_list.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Workouts{% endblock %} diff --git a/rowers/templates/gdpr_optin.html b/rowers/templates/gdpr_optin.html index a5a68a63..9e084f75 100644 --- a/rowers/templates/gdpr_optin.html +++ b/rowers/templates/gdpr_optin.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}GDPR Opt-In{% endblock %} diff --git a/rowers/templates/goldmedalscores.html b/rowers/templates/goldmedalscores.html index 2cd05773..020db44c 100644 --- a/rowers/templates/goldmedalscores.html +++ b/rowers/templates/goldmedalscores.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Gold Medal Score {% endblock %} diff --git a/rowers/templates/graphimage_delete_confirm.html b/rowers/templates/graphimage_delete_confirm.html index 8e8a6c02..d1f39b21 100644 --- a/rowers/templates/graphimage_delete_confirm.html +++ b/rowers/templates/graphimage_delete_confirm.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Delete Graph Image {% endblock %} diff --git a/rowers/templates/help.html b/rowers/templates/help.html index cf49d2f7..85f1b893 100644 --- a/rowers/templates/help.html +++ b/rowers/templates/help.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block main %} diff --git a/rowers/templates/histo.html b/rowers/templates/histo.html index be333c76..cbb641c7 100644 --- a/rowers/templates/histo.html +++ b/rowers/templates/histo.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall {% endblock %} diff --git a/rowers/templates/histo_single.html b/rowers/templates/histo_single.html index fce8843e..85539731 100644 --- a/rowers/templates/histo_single.html +++ b/rowers/templates/histo_single.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}View Workout {% endblock %} diff --git a/rowers/templates/history.html b/rowers/templates/history.html index e66e58ca..819b0ff5 100644 --- a/rowers/templates/history.html +++ b/rowers/templates/history.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall {% endblock %} diff --git a/rowers/templates/image_form.html b/rowers/templates/image_form.html index 43182ced..23804475 100644 --- a/rowers/templates/image_form.html +++ b/rowers/templates/image_form.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}File loading{% endblock %} diff --git a/rowers/templates/image_page.html b/rowers/templates/image_page.html index 96c34955..b56bd322 100644 --- a/rowers/templates/image_page.html +++ b/rowers/templates/image_page.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load staticfiles %} +{% load static %} {% block title %}Here's your plot{% endblock %} diff --git a/rowers/templates/indoorvirtualeventcreate.html b/rowers/templates/indoorvirtualeventcreate.html index 8ec29004..336990c5 100644 --- a/rowers/templates/indoorvirtualeventcreate.html +++ b/rowers/templates/indoorvirtualeventcreate.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}New Virtual Challenge{% endblock %} diff --git a/rowers/templates/instantplan.html b/rowers/templates/instantplan.html index b581bd5d..5cfbe7fc 100644 --- a/rowers/templates/instantplan.html +++ b/rowers/templates/instantplan.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}{{ plan.name }}{% endblock %} diff --git a/rowers/templates/instantplans.html b/rowers/templates/instantplans.html index 6382fbd5..6176d9b9 100644 --- a/rowers/templates/instantplans.html +++ b/rowers/templates/instantplans.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Training Plans{% endblock %} diff --git a/rowers/templates/instroke.html b/rowers/templates/instroke.html index 09282e17..10c526be 100644 --- a/rowers/templates/instroke.html +++ b/rowers/templates/instroke.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Advanced Features {% endblock %} diff --git a/rowers/templates/laboratory.html b/rowers/templates/laboratory.html index 41fe9cb0..15b27e02 100644 --- a/rowers/templates/laboratory.html +++ b/rowers/templates/laboratory.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall - Analysis {% endblock %} diff --git a/rowers/templates/list_courses.html b/rowers/templates/list_courses.html index bd99a4f7..bab2409f 100644 --- a/rowers/templates/list_courses.html +++ b/rowers/templates/list_courses.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Courses List{% endblock %} diff --git a/rowers/templates/list_graphs.html b/rowers/templates/list_graphs.html index 8daf3046..1dfa9d78 100644 --- a/rowers/templates/list_graphs.html +++ b/rowers/templates/list_graphs.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Recent Graphs{% endblock %} diff --git a/rowers/templates/list_standards.html b/rowers/templates/list_standards.html index b99ac07f..e30d8492 100644 --- a/rowers/templates/list_standards.html +++ b/rowers/templates/list_standards.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Course Standards List{% endblock %} diff --git a/rowers/templates/list_videos.html b/rowers/templates/list_videos.html index 4e1dfa33..748db1c1 100644 --- a/rowers/templates/list_videos.html +++ b/rowers/templates/list_videos.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Recent Video Analyses{% endblock %} diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 991ff27a..21c5944d 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}Rowsandall Workouts List{% endblock %} diff --git a/rowers/templates/logo_form.html b/rowers/templates/logo_form.html index 9482267a..82929c99 100644 --- a/rowers/templates/logo_form.html +++ b/rowers/templates/logo_form.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% block title %}File loading{% endblock %} diff --git a/rowers/templates/manualadd.html b/rowers/templates/manualadd.html index 09a435f0..0ec7f110 100644 --- a/rowers/templates/manualadd.html +++ b/rowers/templates/manualadd.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load tz %} diff --git a/rowers/templates/map_view.html b/rowers/templates/map_view.html index 93d9677c..676aa566 100644 --- a/rowers/templates/map_view.html +++ b/rowers/templates/map_view.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load leaflet_tags %} diff --git a/rowers/templates/mapcompare.html b/rowers/templates/mapcompare.html index be79b5c3..4d219412 100644 --- a/rowers/templates/mapcompare.html +++ b/rowers/templates/mapcompare.html @@ -1,5 +1,5 @@ {% extends "newbase.html" %} -{% load staticfiles %} +{% load static %} {% load rowerfilters %} {% load leaflet_tags %} diff --git a/rowers/templates/menu_analytics.html b/rowers/templates/menu_analytics.html index 2bf2760f..0f12d35d 100644 --- a/rowers/templates/menu_analytics.html +++ b/rowers/templates/menu_analytics.html @@ -1,4 +1,4 @@ -{% load staticfiles %} +{% load static %} {% load rowerfilters %}

Analysis