small speed gain
This commit is contained in:
@@ -1111,6 +1111,8 @@ def calculate_goldmedalstandard(rower,workout,recurrance=True):
|
||||
|
||||
if df.empty and recurrance:
|
||||
df, delta, cpvalues = setcp(workout,recurrance=False)
|
||||
if df.empty:
|
||||
return 0,0
|
||||
|
||||
age = calculate_age(rower.birthdate,today=workout.date)
|
||||
|
||||
@@ -1209,9 +1211,11 @@ def setcp(workout,background=False,recurrance=True):
|
||||
filename = 'media/cpdata_{id}.parquet.gz'.format(id=workout.id)
|
||||
|
||||
strokesdf = getsmallrowdata_db(['power','workoutid','time'],ids = [workout.id])
|
||||
if strokesdf['power'].std()==0:
|
||||
return pd.DataFrame(),pd.Series(),pd.Series()
|
||||
if background:
|
||||
job = myqueue(queuelow,handle_setcp,strokesdf,filename,workout.id)
|
||||
return job.id
|
||||
return pd.DataFrame({'delta':[],'cp':[]}),pd.Series(),pd.Series()
|
||||
|
||||
|
||||
if not strokesdf.empty:
|
||||
@@ -1492,7 +1496,6 @@ def checkduplicates(r,workoutdate,workoutstartdatetime,workoutenddatetime):
|
||||
t = ww.duration
|
||||
delta = datetime.timedelta(hours=t.hour, minutes=t.minute, seconds=t.second)
|
||||
enddatetime = ww.startdatetime+delta
|
||||
print(enddatetime,workoutstartdatetime)
|
||||
if enddatetime > workoutstartdatetime:
|
||||
ws2.append(ww)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user