Fix workouts per week graph, it was erroneously showing sets per week (perhaps add sets/number of exercises per week)

This commit is contained in:
Peter Stockings
2023-12-11 22:04:05 +11:00
parent d54cbe1d17
commit 434e6a7250

View File

@@ -338,7 +338,8 @@ def get_workout_counts(workouts, period='week'):
for period_start in person_data["PRCounts"]: for period_start in person_data["PRCounts"]:
period_end = period_start + pd.DateOffset(weeks=1) if period == 'week' else period_start + pd.DateOffset(months=1) period_end = period_start + pd.DateOffset(weeks=1) if period == 'week' else period_start + pd.DateOffset(months=1)
period_workouts = person_df[(person_df['StartDate'] >= period_start) & (person_df['StartDate'] < period_end)] period_workouts = person_df[(person_df['StartDate'] >= period_start) & (person_df['StartDate'] < period_end)]
person_data["PRCounts"][period_start] = len(period_workouts) period_workout_count = period_workouts['WorkoutId'].unique()
person_data["PRCounts"][period_start] = len(period_workout_count)
return workout_counts return workout_counts