added hrScore to stats and plannedsessions
in plannedsessions, if rScore = 0, taking hrScore
This commit is contained in:
@@ -111,8 +111,13 @@ def get_session_metrics(ps):
|
||||
for w in ws:
|
||||
distancev += w.distance
|
||||
durationv += timefield_to_seconds_duration(w.duration)
|
||||
trimpv += dataprep.workout_trimp(w)
|
||||
rscorev += dataprep.workout_rscore(w)[0]
|
||||
thetrimp,hrtss = dataprep.workout_trimp(w)
|
||||
trimpv += thetrimp
|
||||
tss = dataprep.workout_rscore(w)[0]
|
||||
if not np.isnan(tss) and tss != 0:
|
||||
rscorev += tss
|
||||
elif tss == 0:
|
||||
rscorev += hrtss
|
||||
|
||||
ratio,statusv,completiondate = is_session_complete_ws(ws,ps)
|
||||
try:
|
||||
@@ -181,11 +186,16 @@ def is_session_complete_ws(ws,ps):
|
||||
durationseconds = timefield_to_seconds_duration(w.duration)
|
||||
score += durationseconds
|
||||
elif ps.sessionmode == 'TRIMP':
|
||||
trimp = dataprep.workout_trimp(w)
|
||||
trimp,hrtss = dataprep.workout_trimp(w)
|
||||
score += trimp
|
||||
elif ps.sessionmode == 'rScore':
|
||||
rscore = dataprep.workout_rscore(w)[0]
|
||||
score += rscore
|
||||
if not np.isnan(rscore) and rscore != 0:
|
||||
score += rscore
|
||||
elif rscore == 0:
|
||||
trimp,hrtss = dataprep.workout_trimp(w)
|
||||
score += hrtss
|
||||
|
||||
if not completiondate and score>=cratiomin*value:
|
||||
completiondate = w.date
|
||||
|
||||
|
||||
Reference in New Issue
Block a user