hotfix OTW CP chart
This commit is contained in:
@@ -719,7 +719,13 @@ def fetchcp(rower,theworkouts,table='cpdata'):
|
||||
return pd.Series([]),pd.Series([]),avgpower2
|
||||
|
||||
dfgrouped = df.groupby(['workoutid'])
|
||||
avgpower2 = dict(dfgrouped.mean()['power'].astype(int))
|
||||
try:
|
||||
avgpower2 = dict(dfgrouped.mean()['power'].astype(int))
|
||||
except KeyError:
|
||||
avgpower2 = {}
|
||||
for id in theids:
|
||||
avgpower2[id] = 0
|
||||
return pd.Series([]),pd.Series([]),avgpower2
|
||||
|
||||
cpdf = getcpdata_sql(rower.id,table=table)
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ class UploadOptionsForm(forms.Form):
|
||||
plotchoices = (
|
||||
('timeplot','Time Plot'),
|
||||
('distanceplot','Distance Plot'),
|
||||
('pieplot','Pie Chart'),
|
||||
('pieplot','Heart Rate Pie Chart'),
|
||||
)
|
||||
make_plot = forms.BooleanField(initial=False,required=False)
|
||||
plottype = forms.ChoiceField(required=False,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="grid_2 alpha">
|
||||
<p>
|
||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/addpiechart">Add Pie Chart</a>
|
||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/addpiechart">Add HR Pie Chart</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid_2 alpha">
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
<p>
|
||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/addpiechart">Add Pie Chart</a>
|
||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/addpiechart">Add HR Pie Chart</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid_6 alpha">
|
||||
|
||||
Reference in New Issue
Block a user