fixing fit api
This commit is contained in:
@@ -189,7 +189,10 @@ def sort_coordinates_ccw(coordinates):
|
|||||||
def crewnerdcourse(doc):
|
def crewnerdcourse(doc):
|
||||||
courses = []
|
courses = []
|
||||||
for course in doc:
|
for course in doc:
|
||||||
name = course.findall('.//opengis:name', ns)[0].text
|
try:
|
||||||
|
name = course.findall('.//opengis:name', ns)[0].text
|
||||||
|
except IndexError:
|
||||||
|
name = 'No name'
|
||||||
try:
|
try:
|
||||||
description = course.findall('.//opengis:description', ns)[0].text
|
description = course.findall('.//opengis:description', ns)[0].text
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
|||||||
@@ -1283,7 +1283,12 @@ def handle_check_race_course(self,
|
|||||||
dologging(logfile2,"Did not find file "+f1)
|
dologging(logfile2,"Did not find file "+f1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
row.extend_data()
|
try:
|
||||||
|
row.extend_data()
|
||||||
|
except KeyError: # pragma: no cover
|
||||||
|
dologging(logfile,"Could not extend data")
|
||||||
|
dologging(logfile2,"Could not extend data")
|
||||||
|
return 0
|
||||||
|
|
||||||
# row.df.interpolate(inplace=True)
|
# row.df.interpolate(inplace=True)
|
||||||
|
|
||||||
@@ -1315,8 +1320,11 @@ def handle_check_race_course(self,
|
|||||||
).values
|
).values
|
||||||
|
|
||||||
rowdata = rowdata.select_dtypes(['number'])
|
rowdata = rowdata.select_dtypes(['number'])
|
||||||
rowdata = rowdata.resample('100ms', on='dt').mean()
|
try:
|
||||||
rowdata = rowdata.interpolate()
|
rowdata = rowdata.resample('100ms', on='dt').mean()
|
||||||
|
rowdata = rowdata.interpolate()
|
||||||
|
except TypeError: # pragma: no cover
|
||||||
|
pass
|
||||||
|
|
||||||
course = GeoCourse.objects.get(id=courseid)
|
course = GeoCourse.objects.get(id=courseid)
|
||||||
polygons = course.polygons.all()
|
polygons = course.polygons.all()
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -644,7 +644,7 @@ def strokedata_fit(request):
|
|||||||
dologging('apilog.log','FIT API endpoint')
|
dologging('apilog.log','FIT API endpoint')
|
||||||
dologging('apilog.log',e)
|
dologging('apilog.log',e)
|
||||||
_ = myqueue(queuehigh, handle_sendemail_unrecognized, fit_filename, "fit parser")
|
_ = myqueue(queuehigh, handle_sendemail_unrecognized, fit_filename, "fit parser")
|
||||||
return HttpResponse(status=500)
|
return JSONResponse({"error": "the uploaded file is corrupted or invalid and cannot be processed"}, status=422)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user