Private
Public Access
1
0

Merge branch 'develop' into feature/analysis2

This commit is contained in:
Sander Roosendaal
2019-04-29 16:20:47 +02:00
6 changed files with 12 additions and 15 deletions

View File

@@ -2102,6 +2102,7 @@ def add_efficiency(id=0):
def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True,
empower=True, inboard=0.88, forceunit='lbs'):
if rowdatadf.empty:
return 0

View File

@@ -1233,20 +1233,20 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
data['ergpace'] = ergpace*1e3
data['nowindpace'] = nowindpace*1e3
data['ergpace'] = ergpace*1.e3
data['nowindpace'] = nowindpace*1.e3
data['equivergpower'] = equivergpower
data['fergpace'] = nicepaceformat(ergpace2)
data['fnowindpace'] = nicepaceformat(nowindpace2)
data['efficiency'] = efficiency
data = data.replace([-np.inf,np.inf],np.nan)
data = data.fillna(method='ffill')
data.dropna(axis=0,inplace=True,how='all')
data.dropna(axis=1,inplace=True,how='any')
# write data if id given
if id != 0:
data['workoutid'] = id
@@ -1257,14 +1257,7 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
engine = create_engine(database_url, echo=False)
with engine.connect() as conn, conn.begin():
try:
data.to_sql('strokedata',engine,if_exists='append',index=False)
except:
data.drop(columns=['rhythm'],inplace=True)
try:
data.to_sql('strokedata',engine,if_exists='append',index=False)
except:
pass
data.to_sql('strokedata',engine,if_exists='append',index=False)
conn.close()
engine.dispose()

View File

@@ -4822,6 +4822,9 @@ def interactive_otw_advanced_pace_chart(id=0,promember=0):
rowdata
)
plot = Figure(x_axis_type="datetime",y_axis_type="datetime",
tools=TOOLS,

View File

@@ -1455,7 +1455,7 @@ def handle_otwsetpower(self,f1, boattype, weightvalue,
except KeyError:
pass
df = getsmallrowdata_db(
['power', 'workoutid', 'time'], ids=[encoder.decode_hex(workoutid)],
['power', 'workoutid', 'time'], ids=[workoutid],
debug=debug)
thesecs = totaltime
maxt = 1.05 * thesecs
@@ -1468,7 +1468,7 @@ def handle_otwsetpower(self,f1, boattype, weightvalue,
delta, cpvalues, ps[0], ps[1], ps[2], ps[3], ratio)
if res:
handle_sendemail_breakthrough(
encoder.decode_hex(workoutid), email,
workoutid, email,
first_name,
last_name, btvalues=btvalues.to_json())
@@ -1481,7 +1481,7 @@ def handle_otwsetpower(self,f1, boattype, weightvalue,
d = {
'first_name':first_name,
'siteurl':siteurl,
'workoutid':workoutid,
'workoutid':encoder.encode_hex(workoutid),
}
res = send_template_email(from_email,[fullemail],

Binary file not shown.

View File

@@ -2190,7 +2190,7 @@ def workout_otwsetpower_view(request,id=0,message="",successmessage=""):
job = myqueue(queuelow,
handle_otwsetpower,f1,boattype,
weightvalue,
first_name,last_name,emailaddress,id,
first_name,last_name,emailaddress,encoder.decode_hex(id),
ps=[r.p0,r.p1,r.p2,r.p3],
ratio=r.cpratio,
quick_calc = quick_calc,