changing verdict names
This commit is contained in:
@@ -220,11 +220,11 @@ def get_session_metrics(ps):
|
||||
return thedict
|
||||
|
||||
cratiocolors = {
|
||||
'started': "lightgreen",
|
||||
'almost complete': "mediumgreen",
|
||||
'completed': "green",
|
||||
'a bit too much': "purple",
|
||||
'way too much': "violet",
|
||||
'better than nothing': "lightgreen",
|
||||
'partial': "mediumgreen",
|
||||
'on target': "green",
|
||||
'over target': "purple",
|
||||
'way over target': "violet",
|
||||
'missed': "black",
|
||||
'not done': "white",
|
||||
}
|
||||
@@ -250,11 +250,11 @@ def is_session_complete_ws(ws,ps):
|
||||
cratiomax = 1
|
||||
|
||||
cratios = {
|
||||
'started':0,
|
||||
'almost complete':0.6,
|
||||
'completed':0.8,
|
||||
'a bit too much':1.2,
|
||||
'way too much': 1.5
|
||||
'better than nothing':0,
|
||||
'partial':0.6,
|
||||
'on target':0.8,
|
||||
'over target':1.2,
|
||||
'way over target': 1.5
|
||||
}
|
||||
|
||||
|
||||
@@ -263,8 +263,8 @@ def is_session_complete_ws(ws,ps):
|
||||
cratiomin = 0.8
|
||||
cratiomax = 1.2
|
||||
else:
|
||||
cratios['completed'] = 0.9167
|
||||
cratios['a bit too much'] = 1.0833
|
||||
cratios['on target'] = 0.9167
|
||||
cratios['over target'] = 1.0833
|
||||
cratiomin = 0.9167
|
||||
cratiomax = 1.0833
|
||||
|
||||
@@ -293,19 +293,19 @@ def is_session_complete_ws(ws,ps):
|
||||
|
||||
ratio = score/float(value)
|
||||
|
||||
verdict = 'started'
|
||||
verdict = 'better than nothing'
|
||||
|
||||
if ps.sessiontype in ['session','cycletarget']:
|
||||
if ps.criterium == 'exact':
|
||||
if ratio == 1.0:
|
||||
return ratio,'completed',completiondate
|
||||
return ratio,'on target',completiondate
|
||||
else:
|
||||
if not completiondate:
|
||||
completiondate = ws.reverse()[0].date
|
||||
return ratio,'partial',completiondate
|
||||
elif ps.criterium == 'minimum':
|
||||
if ratio >= 1.0:
|
||||
return ratio,'completed',completiondate
|
||||
return ratio,'on target',completiondate
|
||||
else:
|
||||
if not completiondate:
|
||||
completiondate = ws.reverse()[0].date
|
||||
@@ -320,18 +320,18 @@ def is_session_complete_ws(ws,ps):
|
||||
return ratio,verdict,completiondate
|
||||
elif ps.sessiontype == 'test':
|
||||
if ratio==1.0:
|
||||
return ratio,'completed',completiondate
|
||||
return ratio,'on target',completiondate
|
||||
else:
|
||||
return ratio,'partial',completiondate
|
||||
elif ps.sessiontype == 'challenge':
|
||||
if ps.criterium == 'exact':
|
||||
if ratio == 1.0:
|
||||
return ratio,'completed',completiondate
|
||||
return ratio,'on target',completiondate
|
||||
else:
|
||||
return ratio,'partial',completiondate
|
||||
elif ps.criterium == 'minimum':
|
||||
if ratio > 1.0:
|
||||
return ratio,'completed',completiondate
|
||||
return ratio,'on target',completiondate
|
||||
else:
|
||||
if not completiondate:
|
||||
completiondate = ws.reverse()[0].date
|
||||
@@ -347,7 +347,7 @@ def is_session_complete_ws(ws,ps):
|
||||
if record.workoutid in wids:
|
||||
if record.coursecompleted:
|
||||
ratio = record.distance/ps.sessionvalue
|
||||
return ratio,'completed',completiondate
|
||||
return ratio,'on target',completiondate
|
||||
else:
|
||||
ratio = record.distance/ps.sessionvalue
|
||||
return ratio,'partial',completiondate
|
||||
@@ -359,7 +359,7 @@ def is_session_complete_ws(ws,ps):
|
||||
if record.workoutid in wids:
|
||||
if record.coursecompleted:
|
||||
ratio = record.distance/float(ps.sessionvalue)
|
||||
return ratio,'completed',completiondate
|
||||
return ratio,'on target',completiondate
|
||||
else:
|
||||
ratio = record.distance/float(ps.sessionvalue)
|
||||
return ratio,'partial',completiondate
|
||||
|
||||
Reference in New Issue
Block a user