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