fixing strava imports
This commit is contained in:
@@ -529,9 +529,14 @@ def add_workout_from_data(user,importid,data,strokedata,
|
||||
try:
|
||||
latcoord = strokedata.loc[:,'lat']
|
||||
loncoord = strokedata.loc[:,'lon']
|
||||
if latcoord.std() == 0 and loncoord.std() == 0 and workouttype == 'water':
|
||||
workouttype = 'rower'
|
||||
except:
|
||||
latcoord = np.zeros(nr_rows)
|
||||
loncoord = np.zeros(nr_rows)
|
||||
if workouttype == 'water':
|
||||
workouttype = 'rower'
|
||||
|
||||
|
||||
|
||||
try:
|
||||
@@ -747,12 +752,18 @@ def handle_strava_import_stroke_data(title,
|
||||
try:
|
||||
lat = coords[:,0]
|
||||
lon = coords[:,1]
|
||||
if lat.std() == 0 and lon.std() == 0 and workouttype == 'water':
|
||||
workouttype = 'rower'
|
||||
except IndexError:
|
||||
lat = np.zeros(len(t))
|
||||
lon = np.zeros(len(t))
|
||||
if workouttype == 'water':
|
||||
workouttype = 'rower'
|
||||
else:
|
||||
lat = np.zeros(len(t))
|
||||
lon = np.zeros(len(t))
|
||||
if workouttype == 'water':
|
||||
workouttype = 'rower'
|
||||
|
||||
strokelength = velo*60./(spm)
|
||||
strokelength[np.isinf(strokelength)] = 0.0
|
||||
|
||||
Reference in New Issue
Block a user