Private
Public Access
1
0

corrected work per stroke error (wasn't calculated when it could)

This commit is contained in:
Sander Roosendaal
2017-08-08 11:51:41 +02:00
parent bd4020d9a9
commit fc23750731
3 changed files with 81 additions and 33 deletions

View File

@@ -1090,6 +1090,7 @@ def read_cols_df_sql(ids,columns):
# drop columns that are not in offical list
# axx = [ax[0] for ax in axes]
axx = [f.name for f in StrokeData._meta.get_fields()]
for c in columns:
if not c in axx:
columns.remove(c)
@@ -1118,10 +1119,12 @@ def read_cols_df_sql(ids,columns):
ids = tuple(ids),
))
connection = engine.raw_connection()
df = pd.read_sql_query(query,engine)
df = df.fillna(value=0)
df = df.fillna(value=0)
try:
df['peakforce'] = df['peakforce']*lbstoN
except KeyError:
@@ -1425,7 +1428,7 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
try:
driveenergy = rowdatadf.ix[:,'driveenergy']
except KeyError:
driveenergy = 0*power
driveenergy = power*60/spm
else:
driveenergy = data['driveenergy']