Merge branch 'develop' into feature/autostrava
This commit is contained in:
@@ -328,7 +328,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
|||||||
'peakforceangle','peakforce','spm','distance',
|
'peakforceangle','peakforce','spm','distance',
|
||||||
'workoutstate','driveenergy']
|
'workoutstate','driveenergy']
|
||||||
|
|
||||||
rowdata = dataprep.getsmallrowdata_db(columns,ids=ids)
|
rowdata = dataprep.getsmallrowdata_db(columns,ids=ids,
|
||||||
|
workstrokesonly=workstrokesonly)
|
||||||
|
|
||||||
rowdata.dropna(axis=1,how='all',inplace=True)
|
rowdata.dropna(axis=1,how='all',inplace=True)
|
||||||
rowdata.dropna(axis=0,how='any',inplace=True)
|
rowdata.dropna(axis=0,how='any',inplace=True)
|
||||||
@@ -2214,16 +2215,18 @@ def interactive_chart(id=0,promember=0,intervaldata = {}):
|
|||||||
intervaldf = pd.DataFrame(intervaldata)
|
intervaldf = pd.DataFrame(intervaldata)
|
||||||
intervaldf['itime'] = intervaldf['itime']*1.e3
|
intervaldf['itime'] = intervaldf['itime']*1.e3
|
||||||
intervaldf['time'] = intervaldf['itime'].cumsum()
|
intervaldf['time'] = intervaldf['itime'].cumsum()
|
||||||
intervaldf['time_r'] = intervaldf['time'] +intervaldf['itime'].shift(-1)
|
intervaldf['time'] = intervaldf['time'].shift(1)
|
||||||
intervaldf['value'] = 10
|
intervaldf.ix[0,'time'] = 0
|
||||||
|
intervaldf['time_r'] = intervaldf['time'] +intervaldf['itime']
|
||||||
|
intervaldf['value'] = 100
|
||||||
mask = intervaldf['itype'] == 3
|
mask = intervaldf['itype'] == 3
|
||||||
intervaldf.loc[mask,'value'] = 45
|
intervaldf.loc[mask,'value'] = 0
|
||||||
intervaldf['bottom'] = 10
|
intervaldf['bottom'] = 10
|
||||||
|
|
||||||
intervalsource = ColumnDataSource(
|
intervalsource = ColumnDataSource(
|
||||||
intervaldf
|
intervaldf
|
||||||
)
|
)
|
||||||
|
|
||||||
plot.quad(left='time',top='value',bottom='bottom',
|
plot.quad(left='time',top='value',bottom='bottom',
|
||||||
right='time_r',source=intervalsource,color='mediumvioletred',
|
right='time_r',source=intervalsource,color='mediumvioletred',
|
||||||
y_range_name='spmax',fill_alpha=0.2,line_alpha=0.2)
|
y_range_name='spmax',fill_alpha=0.2,line_alpha=0.2)
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ from stravalib.exc import ActivityUploadFailed,TimeoutExceeded
|
|||||||
|
|
||||||
from rowsandall_app.settings import C2_CLIENT_ID, C2_REDIRECT_URI, C2_CLIENT_SECRET, STRAVA_CLIENT_ID, STRAVA_REDIRECT_URI, STRAVA_CLIENT_SECRET
|
from rowsandall_app.settings import C2_CLIENT_ID, C2_REDIRECT_URI, C2_CLIENT_SECRET, STRAVA_CLIENT_ID, STRAVA_REDIRECT_URI, STRAVA_CLIENT_SECRET
|
||||||
|
|
||||||
|
try:
|
||||||
|
from json.decoder import JSONDecodeError
|
||||||
|
except ImportError:
|
||||||
|
JSONDecodeError = ValueError
|
||||||
|
|
||||||
# Exponentially weighted moving average
|
# Exponentially weighted moving average
|
||||||
# Used for data smoothing of the jagged data obtained by Strava
|
# Used for data smoothing of the jagged data obtained by Strava
|
||||||
# See bitbucket issue 72
|
# See bitbucket issue 72
|
||||||
@@ -109,7 +114,7 @@ def get_token(code):
|
|||||||
try:
|
try:
|
||||||
token_json = response.json()
|
token_json = response.json()
|
||||||
thetoken = token_json['access_token']
|
thetoken = token_json['access_token']
|
||||||
except KeyError:
|
except (KeyError,JSONDecodeError):
|
||||||
thetoken = 0
|
thetoken = 0
|
||||||
|
|
||||||
return [thetoken]
|
return [thetoken]
|
||||||
|
|||||||
@@ -1409,8 +1409,11 @@ def add_workout_from_runkeeperdata(user,importid,data):
|
|||||||
|
|
||||||
|
|
||||||
unixtime = cum_time+starttimeunix
|
unixtime = cum_time+starttimeunix
|
||||||
unixtime[0] = starttimeunix
|
try:
|
||||||
|
unixtime[0] = starttimeunix
|
||||||
|
except IndexError:
|
||||||
|
return (0,'No data to import')
|
||||||
|
|
||||||
df['TimeStamp (sec)'] = unixtime
|
df['TimeStamp (sec)'] = unixtime
|
||||||
|
|
||||||
|
|
||||||
@@ -3365,7 +3368,7 @@ def workout_forcecurve_view(request,id=0,workstrokesonly=False):
|
|||||||
workstrokesonly = True
|
workstrokesonly = True
|
||||||
else:
|
else:
|
||||||
workstrokesonly = False
|
workstrokesonly = False
|
||||||
|
|
||||||
script,div,js_resources,css_resources = interactive_forcecurve([row],
|
script,div,js_resources,css_resources = interactive_forcecurve([row],
|
||||||
workstrokesonly=workstrokesonly)
|
workstrokesonly=workstrokesonly)
|
||||||
|
|
||||||
@@ -11138,7 +11141,7 @@ def workout_split_view(request,id=id):
|
|||||||
r,row,splitsecond,splitmode
|
r,row,splitsecond,splitmode
|
||||||
)
|
)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
messages.error("Something went wrong in Split")
|
messages.error(request,"Something went wrong in Split")
|
||||||
|
|
||||||
for message in mesgs:
|
for message in mesgs:
|
||||||
messages.info(request,message)
|
messages.info(request,message)
|
||||||
|
|||||||
Reference in New Issue
Block a user