Private
Public Access
1
0

bug fix and fairer GPS comparisons

This commit is contained in:
Sander Roosendaal
2020-06-10 08:23:08 +02:00
parent 9a9f0725ba
commit 132ffa856c
3 changed files with 61 additions and 38 deletions

View File

@@ -261,6 +261,18 @@ def pretty_timedelta(secs):
return '{}:{:02}:{:02}'.format(int(hours),int(minutes),int(seconds))
def mapcolors(x):
try:
return mytypes.color_map[x]
except KeyError:
return mytypes.colors[-1]
def maptypes(x):
try:
return mytypes.workouttypes_ordered[x]
except KeyError:
return 'Other'
def interactive_workouttype_piechart(workouts):
if len(workouts) == 0:
return "","Not enough workouts to make a chart"
@@ -286,7 +298,7 @@ def interactive_workouttype_piechart(workouts):
data = pd.DataFrame(data)
data['color'] = data['type'].apply(lambda x:mytypes.color_map[x])
data['color'] = data['type'].apply(lambda x:mapcolors(x))
data['totaltime'] = data['value'].apply(lambda x:pretty_timedelta(x))
data['type'] = data['type'].apply(lambda x:mytypes.workouttypes_ordered[x])