fixed sporttracks and ua exports
This commit is contained in:
@@ -470,7 +470,10 @@ def add_rower_session(r,ps):
|
||||
ps.save()
|
||||
|
||||
return 1
|
||||
|
||||
elif ps.manager.rower == r:
|
||||
ps.rower.add(r)
|
||||
ps.save()
|
||||
|
||||
return 0
|
||||
|
||||
def remove_team_session(t,ps):
|
||||
|
||||
@@ -176,8 +176,9 @@ def createsporttracksworkoutdata(w):
|
||||
hr = hr.tolist()
|
||||
d = d.tolist()
|
||||
spm = spm.tolist()
|
||||
lat = lat.tolist()
|
||||
lon = lon.tolist()
|
||||
if haslatlon:
|
||||
lat = lat.tolist()
|
||||
lon = lon.tolist()
|
||||
power = power.tolist()
|
||||
|
||||
for i in range(len(t)):
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
@@ -105,7 +105,11 @@ def createunderarmourworkoutdata(w):
|
||||
start_time = st.isoformat()
|
||||
|
||||
averagehr = int(row.df[' HRCur (bpm)'].mean())
|
||||
minhr = int(row.df[' HRCur (bpm)'].min())
|
||||
maxhr = int(row.df[' HRCur (bpm)'].max())
|
||||
averagespm = int(row.df[' Cadence (stokes/min)'].mean()/2.)
|
||||
minspm = int(row.df[' Cadence (stokes/min)'].min()/2.)
|
||||
maxspm = int(row.df[' Cadence (stokes/min)'].max()/2.)
|
||||
maxhr = int(row.df[' HRCur (bpm)'].max())
|
||||
duration = w.duration.hour*3600
|
||||
duration += w.duration.minute*60
|
||||
@@ -137,7 +141,12 @@ def createunderarmourworkoutdata(w):
|
||||
spm[0] = spm[1]
|
||||
hr = row.df[' HRCur (bpm)'].astype(int).tolist()
|
||||
speed = row.df[' AverageBoatSpeed (m/s)']
|
||||
speedmin = float(row.df[' AverageBoatSpeed (m/s)'].min())
|
||||
speedmax = float(row.df[' AverageBoatSpeed (m/s)'].max())
|
||||
speedmean = float(row.df[' AverageBoatSpeed (m/s)'].mean())
|
||||
speed = speed.replace(np.inf,0).tolist()
|
||||
|
||||
|
||||
|
||||
haslatlon=1
|
||||
|
||||
@@ -150,7 +159,6 @@ def createunderarmourworkoutdata(w):
|
||||
haslatlon = 0
|
||||
|
||||
|
||||
|
||||
# path data
|
||||
if haslatlon:
|
||||
locdata = []
|
||||
@@ -187,19 +195,20 @@ def createunderarmourworkoutdata(w):
|
||||
"cadence": spmdata,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
aggregates = {
|
||||
"elapsed_time_total": int(duration),
|
||||
"active_time_total": int(duration),
|
||||
"distance_total": int(max(d)),
|
||||
"heartrate_avg": averagehr,
|
||||
"heart_rate_min": int(min(hr)),
|
||||
"heart_rate_max": int(max(hr)),
|
||||
"speed_min": speed.min().astype(float),
|
||||
"speed_max": speed.max().astype(float),
|
||||
"speed_avg": speed.mean(),
|
||||
"cadence_min": int(min(spm)/2.),
|
||||
"cadence_max": int(max(spm)/2.),
|
||||
"heart_rate_min": minhr,
|
||||
"heart_rate_max": maxhr,
|
||||
"speed_min": speedmin,
|
||||
"speed_max": speedmax,
|
||||
"speed_avg": speedmean,
|
||||
"cadence_min": minspm,
|
||||
"cadence_max": maxspm,
|
||||
"cadence_avg": averagespm,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user