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