Private
Public Access
1
0

Merge branch 'release/v9.66'

This commit is contained in:
Sander Roosendaal
2019-04-03 21:19:25 +02:00
6 changed files with 94 additions and 96 deletions

View File

@@ -1193,7 +1193,7 @@ class ForceCurveOptionsForm(forms.Form):
('scatter','Peak Force Scatter Plot'),
('none','Only aggregrate data')
)
plottype = forms.ChoiceField(choices=plotchoices,initial='scatter',
plottype = forms.ChoiceField(choices=plotchoices,initial='line',
label='Individual Stroke Chart Type')

View File

@@ -337,41 +337,8 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
p.toolbar_location = None
p.sizing_mode = 'scale_width'
# p = hv.Bars(df,values='duration',
# label = CatAttr(columns=['date'], sort=False),
# xlabel='Date',
# ylabel='Time',
# title='Activity {d1} to {d2}'.format(
# d1 = startdate.strftime("%Y-%m-%d"),
# d2 = enddate.strftime("%Y-%m-%d"),
# ),
# stack=stack,
# plot_width=350,
# plot_height=250,
# toolbar_location = None,
# )
# for legend in p.legend:
# new_items = []
# for legend_item in legend.items:
# it = legend_item.label['value']
# tot = df[df[stack]==it].duration.sum()
# if tot != 0:
# new_items.append(legend_item)
# legend.items = new_items
# p.legend.location = "top_left"
# p.legend.background_fill_alpha = 0.7
#p.sizing_mode = 'scale_width'
#p.sizing_mode = 'stretch_both'
#p.yaxis.axis_label = 'Minutes'
script,div = components(p)
return script,div
@@ -786,55 +753,69 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
plot.add_layout(avf)
peakflabel = Label(x=355,y=430,x_units='screen',y_units='screen',
peakflabel = Label(x=410,y=460,x_units='screen',y_units='screen',
text="Fpeak: {peakforceav:6.2f}".format(peakforceav=peakforceav),
background_fill_alpha=.7,
background_fill_color='white',
text_color='blue',
)
avflabel = Label(x=365,y=400,x_units='screen',y_units='screen',
avflabel = Label(x=420,y=430,x_units='screen',y_units='screen',
text="Favg: {averageforceav:6.2f}".format(averageforceav=averageforceav),
background_fill_alpha=.7,
background_fill_color='white',
text_color='blue',
)
catchlabel = Label(x=360,y=370,x_units='screen',y_units='screen',
catchlabel = Label(x=415,y=400,x_units='screen',y_units='screen',
text="Catch: {catchav:6.2f}".format(catchav=catchav),
background_fill_alpha=0.7,
background_fill_color='white',
text_color='red',
)
peakforceanglelabel = Label(x=320,y=340,x_units='screen',y_units='screen',
peakforceanglelabel = Label(x=375,y=370,x_units='screen',y_units='screen',
text="Peak angle: {peakforceangleav:6.2f}".format(peakforceangleav=peakforceangleav),
background_fill_alpha=0.7,
background_fill_color='white',
text_color='red',
)
finishlabel = Label(x=355,y=310,x_units='screen',y_units='screen',
finishlabel = Label(x=410,y=340,x_units='screen',y_units='screen',
text="Finish: {finishav:6.2f}".format(finishav=finishav),
background_fill_alpha=0.7,
background_fill_color='white',
text_color='red',
)
sliplabel = Label(x=370,y=280,x_units='screen',y_units='screen',
sliplabel = Label(x=425,y=310,x_units='screen',y_units='screen',
text="Slip: {slipav:6.2f}".format(slipav=slipav-catchav),
background_fill_alpha=0.7,
background_fill_color='white',
text_color='red',
)
washlabel = Label(x=360,y=250,x_units='screen',y_units='screen',
washlabel = Label(x=415,y=280,x_units='screen',y_units='screen',
text="Wash: {washav:6.2f}".format(washav=finishav-washav),
background_fill_alpha=0.7,
background_fill_color='white',
text_color='red',
)
lengthlabel = Label(x=405,y=250, x_units='screen',y_units='screen',
text="Length: {length:6.2f}".format(length=finishav-catchav),
background_fill_alpha=0.7,
background_fill_color='white',
text_color='green'
)
efflengthlabel = Label(x=340,y=220, x_units='screen',y_units='screen',
text="Effective Length: {length:6.2f}".format(length=washav-slipav),
background_fill_alpha=0.7,
background_fill_color='white',
text_color='green'
)
annolabel = Label(x=50,y=450,x_units='screen',y_units='screen',
text='',
background_fill_alpha=0.7,
@@ -859,6 +840,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
plot.add_layout(finishlabel)
plot.add_layout(annolabel)
plot.add_layout(sliderlabel)
plot.add_layout(lengthlabel)
plot.add_layout(efflengthlabel)
plot.xaxis.axis_label = "Angle"
plot.yaxis.axis_label = "Force (N)"
@@ -886,6 +869,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
peakforceanglelabel=peakforceanglelabel,
annolabel=annolabel,
sliderlabel=sliderlabel,
lengthlabel=lengthlabel,
efflengthlabel=efflengthlabel,
plottype=plottype,
sourcemultiline=sourcemultiline,
sourcemultiline2=sourcemultiline2
@@ -988,6 +973,9 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
dataslipwash['xslip'] = [catchav+slipav,finishav-washav]
dataslipwash['yslip'] = [thresholdforce,thresholdforce]
var length = finishav-catchav
var efflength = length-slipav-washav
avf.location = averageforceav
avflabel.text = 'Favg: '+averageforceav.toFixed(2)
catchlabel.text = 'Catch: '+catchav.toFixed(2)
@@ -997,6 +985,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
peakflabel.text = 'Fpeak: '+peakforceav.toFixed(2)
peakforceanglelabel.text = 'Peak angle: '+peakforceangleav.toFixed(2)
annolabel.text = annotation
lengthlabel.text = 'Length: '+length.toFixed(2)
efflengthlabel.text = 'Effective Length: '+efflength.toFixed(2)
console.log(count);
console.log(multilines['x'].length);
@@ -1033,12 +1023,12 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
distmax = 100+100*int(rowdata['distance'].max()/100.)
slider_dist_min = Slider(start=0,end=distmax,value=0,step=1,
slider_dist_min = Slider(start=0,end=distmax,value=0,step=50,
title="Min Distance",callback=callback)
callback.args["mindist"] = slider_dist_min
slider_dist_max = Slider(start=0,end=distmax,value=distmax,
step=1,
step=50,
title="Max Distance",callback=callback)
callback.args["maxdist"] = slider_dist_max
@@ -3323,12 +3313,12 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
except KeyError:
distmax = 1000.
slider_dist_min = Slider(start=0,end=distmax,value=0,step=1,
slider_dist_min = Slider(start=0,end=distmax,value=0,step=50,
title="Min Distance",callback=callback)
callback.args["mindist"] = slider_dist_min
slider_dist_max = Slider(start=0,end=distmax,value=distmax,
step=1,
step=50,
title="Max Distance",callback=callback)
callback.args["maxdist"] = slider_dist_max
@@ -3925,12 +3915,12 @@ def interactive_flex_chart2(id=0,promember=0,
except (KeyError,ValueError):
distmax = 100
slider_dist_min = Slider(start=0,end=distmax,value=0,step=1,
slider_dist_min = Slider(start=0,end=distmax,value=0,step=50,
title="Min Distance",callback=callback)
callback.args["mindist"] = slider_dist_min
slider_dist_max = Slider(start=0,end=distmax,value=distmax,
step=1,
step=50,
title="Max Distance",callback=callback)
callback.args["maxdist"] = slider_dist_max

View File

@@ -106,7 +106,8 @@ def make_new_workout_from_email(rower, datafile, name, cntr=0,testing=False):
if testing:
print('Fileformat = ',fileformat)
if fileformat == 'unknown':
# extension = datafilename[-4:].lower()
# fcopy = "media/"+datafilename[:-4]+"_copy"+extension

View File

@@ -234,6 +234,8 @@ class Command(BaseCommand):
]
except IOError:
rowers = []
except Message.DoesNotExist:
attachment.delete()
for rower in rowers:
if extension == 'zip':
try:

View File

@@ -11,18 +11,6 @@
<ul class="main-content">
<li class="rounder">
<h2>Ranking Pieces</h2>
<a href="/rowers/ote-bests2/">
<div class="vignet">
<img src="/static/img/rankingpiece.png"
alt="Ranking Piece">
</div>
</a>
<p>
Analyze your Concept2 ranking pieces over a date range and predict your pace on other pieces.
</p>
</li>
<li class="rounder">
<h2>Compare Workouts</h2>
{% if team %}
@@ -85,29 +73,6 @@
BETA: Box Chart Statistics of stroke metrics over a date range
</p>
</li>
<li class="rounder">
<h2>OTW Critical Power</h2>
<a href="/rowers/otw-bests/">
<div class="vignet">
<img src="/static/img/otwcp.png" alt="OTW Critical Power">
</div>
</a>
<p>
Analyse power vs piece duration to make predictions. For On-The-Water rowing.
</p>
</li>
<li class="rounder">
<h2>OTE Critical Power</h2>
<a href="/rowers/ote-ranking/">
<div class="vignet">
<img src="/static/img/otecp.png" alt="OTE Critical Power">
</div>
</a>
<p>
Analyse power vs piece duration to make predictions, for erg pieces.
</p>
</li>
<li class="rounder">
<h2>Trend Flex</h2>
<a href="/rowers/user-multiflex-select/">
@@ -131,6 +96,41 @@
Monitoring power duration evidence from all your workouts. Feel free to explore.
</p>
</li>
<li class="rounder">
<h2>Ranking Pieces</h2>
<a href="/rowers/ote-bests2/">
<div class="vignet">
<img src="/static/img/rankingpiece.png"
alt="Ranking Piece">
</div>
</a>
<p>
Analyze your Concept2 ranking pieces over a date range and predict your pace on other pieces.
</p>
</li>
<li class="rounder">
<h2>OTW Critical Power</h2>
<a href="/rowers/otw-bests/">
<div class="vignet">
<img src="/static/img/otwcp.png" alt="OTW Critical Power">
</div>
</a>
<p>
Analyse power vs piece duration to make predictions. For On-The-Water rowing.
</p>
</li>
<li class="rounder">
<h2>OTE Critical Power</h2>
<a href="/rowers/ote-ranking/">
<div class="vignet">
<img src="/static/img/otecp.png" alt="OTE Critical Power">
</div>
</a>
<p>
Analyse power vs piece duration to make predictions, for erg pieces.
</p>
</li>
</ul>

View File

@@ -5,20 +5,30 @@
<li class="has-children" id="fitness">
<input type="checkbox" name="group-fitness" id="group-fitness" checked>
<label for="group-fitness">
<i class="fas fa-watch-fitness fa-fw"></i>&nbsp;Fitness</label>
<i class="fas fa-watch-fitness fa-fw"></i>&nbsp;Fitness
</label>
<ul>
<li id="compare">
{% if team %}
<a href="/rowers/team-compare-select/team/{{ team.id }}/">
<i class="fas fa-balance-scale fa-fw"></i>&nbsp;Compare
</a>
{% else %}
<a href="/rowers/team-compare-select/team/0/">
<i class="fas fa-balance-scale fa-fw"></i>&nbsp;Compare
</a>
{% endif %}
</li>
<li id="fitness-powerprogress">
<a href="/rowers/fitness-progress/">
<i class="far fa-watch-fitness fa-fw"></i>&nbsp;Power Progress
</a>
</li>
<li id="fitness-ranking">
<a href="/rowers/ote-bests2/">
<i class="fas fa-star fa-fw"></i>&nbsp;Ranking Pieces
</a>
</li>
<li id="compare">
{% if team %}
<a href="/rowers/team-compare-select/team/{{ team.id }}/"><i class="fas fa-balance-scale fa-fw"></i>&nbsp;Compare</a>
{% else %}
<a href="/rowers/team-compare-select/team/0/"><i class="fas fa-balance-scale fa-fw"></i>&nbsp;Compare</a>
{% endif %}
</li>
<li id="fitness-otecp">
<a href="/rowers/ote-ranking/">
<i class="fas fa-user-chart fa-fw"></i>&nbsp;CP Chart OTE
@@ -29,11 +39,6 @@
<i class="far fa-user-chart fa-fw"></i>&nbsp;CP Chart OTW
</a>
</li>
<li id="fitness-powerprogress">
<a href="/rowers/fitness-progress/">
<i class="far fa-watch-fitness fa-fw"></i>&nbsp;Power Progress
</a>
</li>
</ul>
</li>
<li class="has-children" id="stats">