fixed alerts, manual testing completed
This commit is contained in:
@@ -101,9 +101,10 @@ def alert_get_stats(alert, nperiod=0): # pragma: no cover
|
|||||||
ids = [w.id for w in workouts]
|
ids = [w.id for w in workouts]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
df = read_data(columns, ids=ids, doclean=True,
|
df = getsmallrowdata_pd(columns, ids=ids, doclean=True,
|
||||||
workstrokesonly=workstrokesonly)
|
workstrokesonly=workstrokesonly)
|
||||||
df = remove_nulls_pl(df)
|
df.dropna(axis=1,how='all',inplace=True)
|
||||||
|
df.dropna(axis=0,how='all',inplace=True)
|
||||||
except:
|
except:
|
||||||
return {
|
return {
|
||||||
'workouts': workouts.count(),
|
'workouts': workouts.count(),
|
||||||
|
|||||||
@@ -231,7 +231,6 @@ def get_video_data(w, groups=['basic'], mode='water'):
|
|||||||
|
|
||||||
df2 = df2.round(decimals=2)
|
df2 = df2.round(decimals=2)
|
||||||
|
|
||||||
boatspeed = (100*df2['velo']).astype(int)/100.
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
coordinates = get_latlon_time(w.id)
|
coordinates = get_latlon_time(w.id)
|
||||||
@@ -245,10 +244,13 @@ def get_video_data(w, groups=['basic'], mode='water'):
|
|||||||
|
|
||||||
coordinates.set_index(pd.to_timedelta(
|
coordinates.set_index(pd.to_timedelta(
|
||||||
coordinates['time'], unit='s'), inplace=True)
|
coordinates['time'], unit='s'), inplace=True)
|
||||||
coordinates = coordinates.resample('1s').mean().interpolate()
|
coordinates = coordinates.resample('1s').first().interpolate().fillna(method='ffill')
|
||||||
coordinates['time'] = coordinates['time']-coordinates['time'].min()
|
#coordinates['time'] = coordinates['time']-coordinates['time'].min()
|
||||||
latitude = coordinates['latitude']
|
df2 = pd.concat([df2, coordinates], axis=1)
|
||||||
longitude = coordinates['longitude']
|
latitude = df2['latitude']
|
||||||
|
longitude = df2['longitude']
|
||||||
|
boatspeed = (100*df2['velo']).astype(int)/100.
|
||||||
|
|
||||||
# bundle data
|
# bundle data
|
||||||
data = {
|
data = {
|
||||||
'boatspeed': boatspeed.values.tolist(),
|
'boatspeed': boatspeed.values.tolist(),
|
||||||
@@ -281,9 +283,6 @@ def get_video_data(w, groups=['basic'], mode='water'):
|
|||||||
except KeyError: # pragma: no cover
|
except KeyError: # pragma: no cover
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for key, value in data.items():
|
|
||||||
print(key, len(value))
|
|
||||||
|
|
||||||
metrics['boatspeed'] = metrics.pop('velo')
|
metrics['boatspeed'] = metrics.pop('velo')
|
||||||
# metrics['workperstroke'] = metrics.pop('driveenergy')
|
# metrics['workperstroke'] = metrics.pop('driveenergy')
|
||||||
metrics = collections.OrderedDict(sorted(metrics.items()))
|
metrics = collections.OrderedDict(sorted(metrics.items()))
|
||||||
|
|||||||
@@ -365,6 +365,8 @@ def interactive_planchart(data, startdate, enddate):
|
|||||||
'data': data_dict,
|
'data': data_dict,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print(data_dict)
|
||||||
|
|
||||||
script, div = get_chart("/plan", chart_data, debug=False)
|
script, div = get_chart("/plan", chart_data, debug=False)
|
||||||
return script, div
|
return script, div
|
||||||
|
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ def get_execution_report(rower, startdate, enddate, plan=None):
|
|||||||
else:
|
else:
|
||||||
plannedscore += 60
|
plannedscore += 60
|
||||||
actualscore += 0
|
actualscore += 0
|
||||||
elif w.hrtss != 0:
|
elif w.hrtss >= 0:
|
||||||
if ratio > 0:
|
if ratio > 0:
|
||||||
plannedscore += w.hrtss/ratio
|
plannedscore += w.hrtss/ratio
|
||||||
actualscore += w.hrtss
|
actualscore += w.hrtss
|
||||||
|
|||||||
Reference in New Issue
Block a user