Few Corrections to the Start Algorithm
This commit is contained in:
parent
8c623171a0
commit
7d8a433d97
1 changed files with 7 additions and 2 deletions
|
@ -829,13 +829,18 @@ def load(project_location):
|
|||
|
||||
# Needed
|
||||
try:
|
||||
data["needed"] = ( 1 - data["fraction"] ) / ( data["duration"] - data["dayspassed"] )
|
||||
alldates = list(reversed(data["dates"].keys()))
|
||||
prevdate = alldates[alldates.index(today)+1]
|
||||
prev_frac = data["dates"][prevdate].get("fractions", {}).get("project", data["fraction"])
|
||||
data["needed"] = ( 1 - prev_frac ) / ( data["duration"] - data["dayspassed"] )
|
||||
except:
|
||||
data["needed"] = 0
|
||||
|
||||
prev_star = data.get("star", 0)
|
||||
try:
|
||||
prev_frac = data["dates"][list(reversed(data["dates"].keys()))[1]].get("fractions", {}).get("project", data["fraction"])
|
||||
alldates = list(reversed(data["dates"].keys()))
|
||||
prevdate = alldates[alldates.index(today)+1]
|
||||
prev_frac = data["dates"][prevdate].get("fractions", {}).get("project", data["fraction"])
|
||||
data["star"] = (data["fraction"] - prev_frac) / data["needed"]
|
||||
except:
|
||||
data["star"] = 0
|
||||
|
|
Loading…
Reference in a new issue