small fix - bars didn't reload with the red in performance chart
This commit is contained in:
@@ -182,20 +182,6 @@ def build_goldmedalstandards(workouts,kfitness):
|
|||||||
|
|
||||||
df.sort_values(['workoutdt'],inplace=True)
|
df.sort_values(['workoutdt'],inplace=True)
|
||||||
|
|
||||||
#for id, row in df.iterrows():
|
|
||||||
# d = row['workoutdt']
|
|
||||||
# dd = d-datetime.timedelta(days=90)
|
|
||||||
# mask = df['workoutdt']>dd
|
|
||||||
# mask2 = df['workoutdt']<=d
|
|
||||||
# df2 = df.where(mask & mask2)
|
|
||||||
# powertest = df2['goldmedalstandard'].max()
|
|
||||||
# idx = df2['goldmedalstandard'].argmax()
|
|
||||||
# durationtest = df2['goldmedalduration'].values[idx]
|
|
||||||
# dates.append(d)
|
|
||||||
# testpower.append(powertest)
|
|
||||||
# testduration.append(durationtest)
|
|
||||||
# fatigues.append(np.nan)
|
|
||||||
# fitnesses.append(np.nan)
|
|
||||||
|
|
||||||
for w in workouts:
|
for w in workouts:
|
||||||
ids = [ww.id for ww in workouts.filter(date__gte=w.date-datetime.timedelta(days=42),
|
ids = [ww.id for ww in workouts.filter(date__gte=w.date-datetime.timedelta(days=42),
|
||||||
@@ -1995,7 +1981,7 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7,
|
|||||||
|
|
||||||
outids = []
|
outids = []
|
||||||
|
|
||||||
if showtests:
|
|
||||||
workouts = Workout.objects.filter(user=user.rower,date__gte=startdate,
|
workouts = Workout.objects.filter(user=user.rower,date__gte=startdate,
|
||||||
date__lte=enddate,
|
date__lte=enddate,
|
||||||
workouttype__in=mytypes.rowtypes,
|
workouttype__in=mytypes.rowtypes,
|
||||||
@@ -2004,6 +1990,7 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7,
|
|||||||
workouts,kfitness
|
workouts,kfitness
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
df = pd.DataFrame({
|
df = pd.DataFrame({
|
||||||
'id': outids,
|
'id': outids,
|
||||||
'date':dates,
|
'date':dates,
|
||||||
@@ -2014,6 +2001,7 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7,
|
|||||||
'impulse':impulses,
|
'impulse':impulses,
|
||||||
})
|
})
|
||||||
df.sort_values(['date'],inplace=True)
|
df.sort_values(['date'],inplace=True)
|
||||||
|
if showtests:
|
||||||
df['testdup'] = df['testpower'].shift(1)
|
df['testdup'] = df['testpower'].shift(1)
|
||||||
df['testpower'] = df.apply(lambda x: newtestpower(x),axis=1)
|
df['testpower'] = df.apply(lambda x: newtestpower(x),axis=1)
|
||||||
df['id'] = df.apply(lambda x: newtestpowerid(x),axis=1)
|
df['id'] = df.apply(lambda x: newtestpowerid(x),axis=1)
|
||||||
@@ -2030,6 +2018,7 @@ def performance_chart(user,startdate=None,enddate=None,kfitness=42,kfatigue=7,
|
|||||||
fitnesses = df['fitness'].values.tolist()
|
fitnesses = df['fitness'].values.tolist()
|
||||||
testduration = df['testduration'].values.tolist()
|
testduration = df['testduration'].values.tolist()
|
||||||
impulses = df['impulse'].tolist()
|
impulses = df['impulse'].tolist()
|
||||||
|
|
||||||
outids = df['id'].unique()
|
outids = df['id'].unique()
|
||||||
|
|
||||||
fatigues,fitnesses,dates,testpower,testduration,impulses = getfatigues(fatigues,
|
fatigues,fitnesses,dates,testpower,testduration,impulses = getfatigues(fatigues,
|
||||||
|
|||||||
Reference in New Issue
Block a user