fixing fit processing and wps average calculation
This commit is contained in:
@@ -1521,7 +1521,10 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
||||
cntr = Workout.objects.filter(user=r, workouttype__in=otwtypes,
|
||||
startdatetime__gt=tz.now()-tz.timedelta(days=42),
|
||||
duplicate=False).count()
|
||||
new_value = (cntr*r.running_wps_erg + row.df['driveenergy'].mean())/(cntr+1.0)
|
||||
try:
|
||||
new_value = (cntr*r.running_wps_erg + row.df['driveenergy'].mean())/(cntr+1.0)
|
||||
except TypeError:
|
||||
new_value = r.running_wps
|
||||
if not (math.isnan(new_value) or math.isinf(new_value) or new_value == 0):
|
||||
r.running_wps = new_value
|
||||
elif not (math.isnan(r.running_wps) or math.isinf(r.running_wps) or r.running_wps == 0):
|
||||
|
||||
Reference in New Issue
Block a user