Private
Public Access
1
0

fixed AttributeError in dataprep (getsmallrowdata_db)

The rdata function returning a number instead of an object leads to
additional code in other parts of the software. Should consider changing
it to return an "empty" rowingdata object.
This commit is contained in:
Sander Roosendaal
2018-01-03 13:00:21 +01:00
parent caf60d28ee
commit c8f12ccc97

View File

@@ -1557,7 +1557,11 @@ def getsmallrowdata_db(columns, ids=[], doclean=True, workstrokesonly=True):
if extracols and len(ids)==1:
w = Workout.objects.get(id=ids[0])
row = rdata(w.csvfilename)
f = row.df['TimeStamp (sec)'].diff().mean()
try:
f = row.df['TimeStamp (sec)'].diff().mean()
except AttributeError:
f = 0
if f != 0 and not np.isnan(f):
windowsize = 2 * (int(10. / (f))) + 1
else: