bug fix and fairer GPS comparisons
This commit is contained in:
@@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user