division by zero fix in dataprep
This commit is contained in:
@@ -759,9 +759,11 @@ def create_row_df(r,distance,duration,startdatetime,
|
||||
totalseconds += duration.second
|
||||
totalseconds += duration.microsecond/1.e6
|
||||
|
||||
|
||||
spm = 60.*nr_strokes/totalseconds
|
||||
|
||||
try:
|
||||
spm = 60.*nr_strokes/totalseconds
|
||||
except ZeroDivisionError:
|
||||
spm = 20.
|
||||
|
||||
step = totalseconds/float(nr_strokes)
|
||||
|
||||
elapsed = np.arange(nr_strokes)*totalseconds/(float(nr_strokes-1))
|
||||
@@ -775,7 +777,10 @@ def create_row_df(r,distance,duration,startdatetime,
|
||||
pace = 500.*totalseconds/distance
|
||||
|
||||
if workouttype in ['rower','slides','dynamic']:
|
||||
velo = distance/totalseconds
|
||||
try:
|
||||
velo = distance/totalseconds
|
||||
except ZeroDivisionError:
|
||||
velo = 2.4
|
||||
power = 2.8*velo**3
|
||||
else:
|
||||
power = 0
|
||||
|
||||
Reference in New Issue
Block a user