Private
Public Access
1
0

strava bug fixed

This commit is contained in:
Sander Roosendaal
2020-05-15 14:24:44 +02:00
parent b403ace434
commit a034c0b3d1
3 changed files with 19 additions and 2 deletions

View File

@@ -322,7 +322,7 @@ def get_workout(user,stravaid):
velo = get_strava_stream(r,'velocity_smooth',stravaid)
d = get_strava_stream(r,'distance',stravaid)
coords = get_strava_stream(r,'latlng',stravaid)
power = get_strava_stream(r,'power',stravaid)
power = get_strava_stream(r,'watts',stravaid)
if t is not None:
nr_rows = len(t)
@@ -388,6 +388,8 @@ def get_workout(user,stravaid):
'strokelength':strokelength,
})
# startdatetime = datetime.datetime.strptime(startdatetime,"%Y-%m-%d-%H:%M:%S")
return [workoutsummary,df]
@@ -736,7 +738,7 @@ def handle_strava_import_stroke_data(title,
velo = get_strava_stream(r,'velocity_smooth',stravaid)
d = get_strava_stream(r,'distance',stravaid)
coords = get_strava_stream(r,'latlng',stravaid)
power = get_strava_stream(r,'power',stravaid)
power = get_strava_stream(r,'watts',stravaid)
if t is not None:
nr_rows = len(t)
@@ -800,6 +802,9 @@ def handle_strava_import_stroke_data(title,
strokedistance = 60.*velo2/spm
if workouttype == 'rower' and pd.Series(power).mean() == 0:
power = 2.8*(velo2**3)
nr_strokes = len(t)
df = pd.DataFrame({'TimeStamp (sec)':unixtime,
@@ -824,6 +829,8 @@ def handle_strava_import_stroke_data(title,
})
df.sort_values(by='TimeStamp (sec)',ascending=True)
res = df.to_csv(csvfilename,index_label='index')