Private
Public Access
1
0

adding dates to cp chart title

This commit is contained in:
Sander Roosendaal
2020-10-18 12:21:49 +02:00
parent d195d45a37
commit 722bfe7f83

View File

@@ -521,11 +521,11 @@ def cpdata(workouts, options):
ids = [w.id for w in workouts]
delta, cpvalue, avgpower,workouts = dataprep.fetchcp_new(r,workouts)
delta, cpvalue, avgpower,workoutnames = dataprep.fetchcp_new(r,workouts)
powerdf = pd.DataFrame({
'Delta':delta,
'CP':cpvalue,
'workout':workouts,
'workout':workoutnames,
})
@@ -540,8 +540,15 @@ def cpdata(workouts, options):
rowername = r.user.first_name+" "+r.user.last_name
if len(powerdf) !=0 :
datefirst = pd.Series(w.date for w in workouts).min()
datelast = pd.Series(w.date for w in workouts).max()
title = 'CP chart for {name}, from {d1} to {d2}'.format(
name = rowername,
d1 = datefirst,
d2 = datelast,
)
res = interactive_otwcpchart(powerdf,promember=True,rowername=rowername,r=r,
cpfit=cpfit)
cpfit=cpfit,title=title)
script = res[0]
div = res[1]
p1 = res[2]