Private
Public Access
1
0

Merge branch 'develop' into feature/fastestchallenges

This commit is contained in:
Sander Roosendaal
2020-11-10 21:45:12 +01:00
3 changed files with 35 additions and 26 deletions

View File

@@ -377,13 +377,19 @@ def getfastest(df,thevalue,mode='distance'):
if tt.max() < thevalue:
return 0
if tmax > 500000:
newlen=int(tmax/2000.)
newt = np.arange(newlen)*tmax/float(newlen)
deltat = newt[1]-newt[0]
else:
newt = np.arange(0,tmax,10.)
deltat = 10.
# if tmax > 500000:
# newlen=int(tmax/2000.)
# newt = np.arange(newlen)*tmax/float(newlen)
# deltat = newt[1]-newt[0]
# else:
# newt = np.arange(0,tmax,10.)
# deltat = 10.
newlen = 1000
newt = np.arange(newlen)*tmax/float(newlen)
deltat = newt[1]-newt[0]
dd = griddata(tt.values,
dd.values,newt,method='linear',rescale=True)

View File

@@ -3480,7 +3480,7 @@ def interactive_windchart(id=0,promember=0):
plot.xaxis.axis_label = "Distance (m)"
plot.yaxis.axis_label = "Wind Speed (m/s)"
plot.y_range = Range1d(-7,7)
plot.sizing_mode = 'scale_both'
plot.sizing_mode = 'stretch_both'
plot.extra_y_ranges = {"winddirection": Range1d(start=0,end=360)}

View File

@@ -1987,28 +1987,31 @@ def plannedsession_view(request,id=0,userid=0):
for record in vs:
userid = record.userid
uu = User.objects.get(id=userid)
w = Workout.objects.get(id=record.workoutid)
wdict = {
'name': uu.first_name+' '+uu.last_name,
'date': w.date,
'distance': record.distance,
'type': w.workouttype,
'coursecompleted':True,
}
try:
w = Workout.objects.get(id=record.workoutid)
wdict = {
'name': uu.first_name+' '+uu.last_name,
'date': w.date,
'distance': record.distance,
'type': w.workouttype,
'coursecompleted':True,
}
coursecompleted = record.coursecompleted
t = record.duration
wdict['time'] = datetime.timedelta(
hours=t.hour,
seconds=t.second,
minutes=t.minute,
microseconds=t.microsecond
)
coursecompleted = record.coursecompleted
t = record.duration
wdict['time'] = datetime.timedelta(
hours=t.hour,
seconds=t.second,
minutes=t.minute,
microseconds=t.microsecond
)
wdict['coursecompleted'] = coursecompleted
wdict['coursecompleted'] = coursecompleted
ranking.append(wdict)
ranking.append(wdict)
except Workout.DoesNotExist:
pass
ranking = sorted(ranking, key=lambda k: k['time'])
if ps.sessiontype == 'fastest_time':