Private
Public Access
1
0

Merge branch 'release/v12.98'

This commit is contained in:
Sander Roosendaal
2020-06-21 10:42:46 +02:00
2 changed files with 30 additions and 0 deletions

View File

@@ -38,6 +38,25 @@ def time_in_path(df,p,maxmin='max',getall=False,name='unknown',logfile=None):
if len(df[b==2]):
if logfile is not None:
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
with open(logfile,'a') as f:
f.write('\n')
f.write(timestamp)
f.write(' ')
f.write(name)
f.write(' ')
f.write(maxmin)
f.write(' ')
f.write(str(getall))
f.write(' ')
f.write(str(len(df[b==2])))
f.write(' ')
if len(df[b==2])>1:
f.write(' passes found')
else:
f.write(' pass found')
if getall:
return df[b==2]['time'],df[b==2]['cum_dist']
else:
@@ -57,6 +76,8 @@ def time_in_path(df,p,maxmin='max',getall=False,name='unknown',logfile=None):
f.write(str(getall))
f.write(' ')
f.write(str(len(df[b==2])))
f.write(' ')
f.write(' pass not found')
raise InvalidTrajectoryError("Trajectory doesn't go through path")

View File

@@ -526,6 +526,11 @@ def statsdata(workouts, options):
datadf = dataprep.clean_df_stats(datadf,workstrokesonly=workstrokesonly)
try:
datadf['pace'] = datadf['pace']/1000.
except KeyError:
pass
# Create stats
stats = {}
# fielddict.pop('workoutstate')
@@ -4169,6 +4174,10 @@ def cumstats(request,userid=0,
datadf,extracols = dataprep.read_cols_df_sql(ids,fieldlist)
datadf = dataprep.clean_df_stats(datadf,workstrokesonly=workstrokesonly)
try:
datadf['pace'] = datadf['pace']/1000.
except KeyError:
pass
request.session['rowerid'] = r.id