Private
Public Access
1
0

importing strava data without time

This commit is contained in:
Sander Roosendaal
2019-05-25 09:49:43 +02:00
parent 3b6cc8b572
commit 2ec230fb98
4 changed files with 16 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ workouttypes = (
('c-boat','Dutch C boat'), ('c-boat','Dutch C boat'),
('churchboat','Finnish Church boat'), ('churchboat','Finnish Church boat'),
('Ride','Ride'), ('Ride','Ride'),
('Bike','Bike'),
('Run','Run'), ('Run','Run'),
('NordicSki','NordicSki'), ('NordicSki','NordicSki'),
('Swim','Swim'), ('Swim','Swim'),
@@ -31,6 +32,7 @@ workouttypes = (
('InlineSkate','InlineSkate'), ('InlineSkate','InlineSkate'),
('Kayaking','Kayaking'), ('Kayaking','Kayaking'),
('Workout','Workout'), ('Workout','Workout'),
('Yoga','Yoga'),
('other','Other'), ('other','Other'),
) )
@@ -60,6 +62,7 @@ stravamapping = collections.OrderedDict({
'InlineSkate':'InlineSkate', 'InlineSkate':'InlineSkate',
'Kayaking':'Kayaking', 'Kayaking':'Kayaking',
'Workout':'Workout', 'Workout':'Workout',
'Yoga':'Yoga',
'other':'Workout', 'other':'Workout',
}) })
@@ -91,6 +94,7 @@ stmapping = collections.OrderedDict({
'InlineSkate':'Skating:InlineSkate', 'InlineSkate':'Skating:InlineSkate',
'Kayaking':'Other:Kayaking', 'Kayaking':'Other:Kayaking',
'Workout':'Other:Workout', 'Workout':'Other:Workout',
'Yoga':'Other',
'other':'Other', 'other':'Other',
}) })
@@ -122,7 +126,7 @@ rkmapping = collections.OrderedDict({
'Kayaking':'Other', 'Kayaking':'Other',
'Workout':'Other', 'Workout':'Other',
'other':'Other', 'other':'Other',
'Yoga':'Other',
}) })
polarmapping = collections.OrderedDict({ polarmapping = collections.OrderedDict({
@@ -152,7 +156,7 @@ polarmapping = collections.OrderedDict({
'Kayaking':'Kayaking', 'Kayaking':'Kayaking',
'Workout':'Other Indoor', 'Workout':'Other Indoor',
'other':'Other Indoor', 'other':'Other Indoor',
'Yoga':'Yoga',
}) })
tpmapping = collections.OrderedDict({ tpmapping = collections.OrderedDict({
@@ -182,7 +186,7 @@ tpmapping = collections.OrderedDict({
'Kayaking':'other', 'Kayaking':'other',
'Workout':'other', 'Workout':'other',
'other':'other', 'other':'other',
'Yoga':'other',
}) })
c2mapping = collections.OrderedDict({ c2mapping = collections.OrderedDict({
@@ -212,6 +216,7 @@ c2mapping = collections.OrderedDict({
'Kayaking':None, 'Kayaking':None,
'Workout':None, 'Workout':None,
'other':None, 'other':None,
'Yoga':None,
}) })

View File

@@ -319,7 +319,11 @@ def get_workout(user,stravaid):
if t is not None: if t is not None:
nr_rows = len(t) nr_rows = len(t)
else: else:
return(0,"Error: Time data wasnt found") duration = int(workoutsummary['elapsed_time'])
t = pd.Series(range(duration+1))
nr_rows = len(t)
if nr_rows == 0: if nr_rows == 0:
return (0,"Error: Time data had zero length") return (0,"Error: Time data had zero length")

View File

@@ -1075,10 +1075,10 @@ class WorkoutStatsTestNew(TestCase):
workouts = self.user_workouts workouts = self.user_workouts
script, div = boxplotdata(workouts,options) script, div = boxplotdata(workouts,options)
script, div = trendflexdata(workouts,options) # script, div = trendflexdata(workouts,options)
# script, div = histodata(workouts,options) # script, div = histodata(workouts,options)
# script, div = flexalldata(workouts,options) script, div = flexalldata(workouts,options)
# script, div = statsdata(workouts,options) script, div = statsdata(workouts,options)
script, div = comparisondata(workouts,options) script, div = comparisondata(workouts,options)

Binary file not shown.