Now writing results
This commit is contained in:
@@ -540,6 +540,10 @@ def handle_check_race_course(self,
|
||||
if 'mode' in kwargs: # pragma: no cover
|
||||
mode = kwargs['mode']
|
||||
|
||||
summary = False
|
||||
if 'summary' in kwargs:
|
||||
summary = kwargs['summary']
|
||||
|
||||
columns = ['time',' latitude',' longitude','cum_dist']
|
||||
|
||||
try:
|
||||
@@ -599,6 +603,7 @@ def handle_check_race_course(self,
|
||||
courseid=courseid
|
||||
)
|
||||
|
||||
|
||||
with engine.connect() as conn, conn.begin():
|
||||
result = conn.execute(query)
|
||||
polygons = result.fetchall()
|
||||
@@ -736,6 +741,33 @@ def handle_check_race_course(self,
|
||||
with engine.connect() as conn, conn.begin():
|
||||
result = conn.execute(query)
|
||||
|
||||
if summary:
|
||||
|
||||
try:
|
||||
row = rdata(csvfile=f1)
|
||||
except IOError: # pragma: no cover
|
||||
try:
|
||||
row = rdata(csvfile=f1 + '.csv')
|
||||
except IOError: # pragma: no cover
|
||||
try:
|
||||
row = rdata(csvfile=f1 + '.gz')
|
||||
except IOError: # pragma: no cover
|
||||
pass
|
||||
|
||||
vals, units, typ = row.updateinterval_metric(
|
||||
' AverageBoatSpeed (m/s)',0.1,mode='larger',
|
||||
debug=False,smoothwindow=15.,
|
||||
activewindow=[startsecond,endsecond]
|
||||
)
|
||||
|
||||
summary = row.allstats()
|
||||
row.write_csv(f1,gzip=True)
|
||||
|
||||
query = "UPDATE `rowers_workout` SET `summary` = '%s' WHERE `id` = %s" % (summary, workoutid)
|
||||
|
||||
with engine.connect() as conn, conn.begin():
|
||||
result = conn.execute(query)
|
||||
|
||||
conn.close()
|
||||
engine.dispose()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user