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

Binary file not shown.

View File

@@ -833,6 +833,7 @@ def step_to_time_dist(step, avgspeed=3.2, ftp=200, ftspm=25, ftv=3.7, powerzones
avgpower = targetpower
if valuelow != 0 and valuehigh != 0: # pragma: no cover
avgpower = (valuelow+valuehigh)/2.
targetpower = ftp*0.6
if avgpower < 10 and avgpower > 0:
targetpower = ftp*0.6
elif avgpower > 10 and avgpower < 1000: