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

View File

@@ -319,7 +319,11 @@ def get_workout(user,stravaid):
if t is not None:
nr_rows = len(t)
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:
return (0,"Error: Time data had zero length")

View File

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

Binary file not shown.