Merge branch 'hotfix/v8.52'
This commit is contained in:
@@ -48,7 +48,12 @@ def cpfit(powerdf):
|
|||||||
theavpower = powerdf['CP']
|
theavpower = powerdf['CP']
|
||||||
|
|
||||||
if len(thesecs)>=4:
|
if len(thesecs)>=4:
|
||||||
p1, success = optimize.leastsq(errfunc, p0[:], args = (thesecs,theavpower))
|
try:
|
||||||
|
p1, success = optimize.leastsq(errfunc, p0[:], args = (thesecs,theavpower))
|
||||||
|
except:
|
||||||
|
factor = fitfunc(p0,thesecs.mean())/theavpower.mean()
|
||||||
|
p1 = [p0[0]/factor,p0[1]/factor,p0[2],p0[3]]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
factor = fitfunc(p0,thesecs.mean())/theavpower.mean()
|
factor = fitfunc(p0,thesecs.mean())/theavpower.mean()
|
||||||
p1 = [p0[0]/factor,p0[1]/factor,p0[2],p0[3]]
|
p1 = [p0[0]/factor,p0[1]/factor,p0[2],p0[3]]
|
||||||
|
|||||||
@@ -4756,10 +4756,19 @@ def oterankings_view(request,theuser=0,
|
|||||||
pieceunit = form.cleaned_data['pieceunit']
|
pieceunit = form.cleaned_data['pieceunit']
|
||||||
else:
|
else:
|
||||||
value = None
|
value = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
trankingdistances = form.cleaned_data['trankingdistances']
|
||||||
|
except KeyError:
|
||||||
|
trankingdistances = []
|
||||||
|
|
||||||
trankingdistances = form.cleaned_data['trankingdistances']
|
|
||||||
trankingdistances = [int(d) for d in trankingdistances]
|
trankingdistances = [int(d) for d in trankingdistances]
|
||||||
trankingdurations = form.cleaned_data['trankingdurations']
|
|
||||||
|
try:
|
||||||
|
trankingdurations = form.cleaned_data['trankingdurations']
|
||||||
|
except KeyError:
|
||||||
|
trankingdurations = []
|
||||||
|
|
||||||
trankingdurations = [
|
trankingdurations = [
|
||||||
datetime.datetime.strptime(d,"%H:%M:%S").time() for d in trankingdurations
|
datetime.datetime.strptime(d,"%H:%M:%S").time() for d in trankingdurations
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user