Private
Public Access
1
0

Merge branch 'develop' into feature/embeddedvideo

This commit is contained in:
Sander Roosendaal
2019-11-19 08:02:21 +01:00
3 changed files with 23 additions and 7 deletions

View File

@@ -347,9 +347,20 @@ def summaryfromsplitdata(splitdata,data,filename,sep='|'):
timebased = False timebased = False
for interval in splitdata: for interval in splitdata:
idist = interval['distance'] try:
itime = interval['time']/10. idist = interval['distance']
ipace = 500.*itime/idist except KeyError:
idist = 0
try:
itime = interval['time']/10.
except KeyError:
itime = 0
try:
ipace = 500.*itime/idist
except (ZeroDivisionError,OverflowError):
ipace = 180.
try: try:
ispm = interval['stroke_rate'] ispm = interval['stroke_rate']
except KeyError: except KeyError:

View File

@@ -3072,9 +3072,9 @@ attrs.update(strokedatafields)
# when the StrokeData are expanded. # when the StrokeData are expanded.
# No Django Instances of this model are managed. Strokedata table is # No Django Instances of this model are managed. Strokedata table is
# accesssed directly with SQL commands # accesssed directly with SQL commands
StrokeData = type(str('StrokeData'), (models.Model,), #StrokeData = type(str('StrokeData'), (models.Model,),
attrs # attrs
) # )
# Storing data for the OTW CP chart # Storing data for the OTW CP chart
class cpdata(models.Model): class cpdata(models.Model):

View File

@@ -2906,7 +2906,12 @@ def workout_data_view(request, id=0):
else: else:
form = DataFrameColumnsForm(initial = {'cols':tcols}) form = DataFrameColumnsForm(initial = {'cols':tcols})
datadf = datadf[tcols] try:
datadf = datadf[tcols]
except KeyError:
tcols = list(set(datadf.columns(tolist)+tcols))
datadf = datadf[tcols]
datadf = datadf.fillna(value=0)
for col in cols: for col in cols:
try: try: