Private
Public Access
1
0

fixing fit processing and wps average calculation

This commit is contained in:
2025-10-20 14:14:17 +02:00
parent 07b9d778de
commit d833c69e79
3 changed files with 5 additions and 1 deletions

View File

@@ -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):