checking in changes
This commit is contained in:
@@ -174,7 +174,7 @@ ratelim==0.1.6
|
|||||||
redis==3.2.1
|
redis==3.2.1
|
||||||
requests==2.21.0
|
requests==2.21.0
|
||||||
requests-oauthlib==1.2.0
|
requests-oauthlib==1.2.0
|
||||||
rowingdata==2.6.6
|
rowingdata==2.6.7
|
||||||
rowingphysics==0.5.0
|
rowingphysics==0.5.0
|
||||||
rq==0.13.0
|
rq==0.13.0
|
||||||
rules==2.1
|
rules==2.1
|
||||||
|
|||||||
@@ -2680,7 +2680,10 @@ def interactive_windchart(id=0,promember=0):
|
|||||||
if rowdata == 0:
|
if rowdata == 0:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
dist = rowdata.df.loc[:,'cum_dist']
|
try:
|
||||||
|
dist = rowdata.df.loc[:,'cum_dist']
|
||||||
|
except KeyError:
|
||||||
|
return ['','No Data Found']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vwind = rowdata.df.loc[:,'vwind']
|
vwind = rowdata.df.loc[:,'vwind']
|
||||||
@@ -2770,7 +2773,10 @@ def interactive_streamchart(id=0,promember=0):
|
|||||||
if rowdata == 0:
|
if rowdata == 0:
|
||||||
return "","No Valid Data Available"
|
return "","No Valid Data Available"
|
||||||
|
|
||||||
dist = rowdata.df.loc[:,'cum_dist']
|
try:
|
||||||
|
dist = rowdata.df.loc[:,'cum_dist']
|
||||||
|
except KeyError:
|
||||||
|
return ['','No Data found']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vstream = rowdata.df.loc[:,'vstream']
|
vstream = rowdata.df.loc[:,'vstream']
|
||||||
|
|||||||
@@ -249,8 +249,11 @@ def workout_csvemail_view(request,id=0):
|
|||||||
rowdate = rowdata.rowdatetime
|
rowdate = rowdata.rowdatetime
|
||||||
starttimeunix = arrow.get(rowdate).timestamp
|
starttimeunix = arrow.get(rowdate).timestamp
|
||||||
df = rowdata.df
|
df = rowdata.df
|
||||||
df[' ElapsedTime (sec)'] = df['TimeStamp (sec)']
|
try:
|
||||||
df['TimeStamp (sec)'] = df['TimeStamp (sec)'] + starttimeunix
|
df[' ElapsedTime (sec)'] = df['TimeStamp (sec)']
|
||||||
|
df['TimeStamp (sec)'] = df['TimeStamp (sec)'] + starttimeunix
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
response = HttpResponse(df.to_csv())
|
response = HttpResponse(df.to_csv())
|
||||||
response['Content-Disposition'] = 'attachment; filename="%s"' % filename
|
response['Content-Disposition'] = 'attachment; filename="%s"' % filename
|
||||||
|
|||||||
@@ -1224,8 +1224,6 @@ def plannedsessions_manage_view(request,userid=0,
|
|||||||
if request.is_ajax():
|
if request.is_ajax():
|
||||||
is_ajax = True
|
is_ajax = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
r = getrequestrower(request,userid=userid)
|
r = getrequestrower(request,userid=userid)
|
||||||
|
|
||||||
startdate,enddate = get_dates_timeperiod(request)
|
startdate,enddate = get_dates_timeperiod(request)
|
||||||
|
|||||||
@@ -347,6 +347,9 @@ def get_user_by_userid(*args,**kwargs):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
id = request.user.id
|
id = request.user.id
|
||||||
|
|
||||||
|
if id is not None and int(id) == 0:
|
||||||
|
id = request.user.id
|
||||||
|
|
||||||
u = get_object_or_404(User,pk=id)
|
u = get_object_or_404(User,pk=id)
|
||||||
return u
|
return u
|
||||||
|
|
||||||
@@ -370,6 +373,9 @@ def getrequestrower(request,rowerid=0,userid=0,notpermanent=False):
|
|||||||
userid = int(userid)
|
userid = int(userid)
|
||||||
rowerid = int(rowerid)
|
rowerid = int(rowerid)
|
||||||
|
|
||||||
|
if userid == 0:
|
||||||
|
userid = request.user.id
|
||||||
|
|
||||||
if notpermanent == False:
|
if notpermanent == False:
|
||||||
if rowerid == 0 and 'rowerid' in request.session:
|
if rowerid == 0 and 'rowerid' in request.session:
|
||||||
rowerid = request.session['rowerid']
|
rowerid = request.session['rowerid']
|
||||||
@@ -977,10 +983,10 @@ def rowhascoordinates(row):
|
|||||||
def rdata(file,rower=rrower()):
|
def rdata(file,rower=rrower()):
|
||||||
try:
|
try:
|
||||||
res = rrdata(csvfile=file,rower=rower)
|
res = rrdata(csvfile=file,rower=rower)
|
||||||
except (IOError, IndexError, EOFError):
|
except (IOError, IndexError, EOFError,FileNotFoundError):
|
||||||
try:
|
try:
|
||||||
res = rrdata(csvfile=file+'.gz',rower=rower)
|
res = rrdata(csvfile=file+'.gz',rower=rower)
|
||||||
except (IOError, IndexError, EOFError):
|
except (IOError, IndexError, EOFError,FileNotFoundError):
|
||||||
res = 0
|
res = 0
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -2944,8 +2944,10 @@ def workout_data_view(request, id=0):
|
|||||||
|
|
||||||
datadf,row = dataprep.getrowdata_db(id=encoder.decode_hex(id))
|
datadf,row = dataprep.getrowdata_db(id=encoder.decode_hex(id))
|
||||||
|
|
||||||
|
try:
|
||||||
datadf.sort_values(['ftime'],inplace=True)
|
datadf.sort_values(['ftime'],inplace=True)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
columns = datadf.columns.values
|
columns = datadf.columns.values
|
||||||
|
|
||||||
@@ -2970,11 +2972,13 @@ def workout_data_view(request, id=0):
|
|||||||
tcols = ['ftime','cumdist','fpace','spm','hr','power']
|
tcols = ['ftime','cumdist','fpace','spm','hr','power']
|
||||||
|
|
||||||
datadf = datadf[cols]
|
datadf = datadf[cols]
|
||||||
datadf.loc[:,'hr'] = datadf['hr'].astype('int')
|
try:
|
||||||
datadf.loc[:,'power'] = datadf['power'].astype('int')
|
datadf.loc[:,'hr'] = datadf['hr'].astype('int')
|
||||||
datadf.loc[:,'distance'] = datadf['distance'].astype('int')
|
datadf.loc[:,'power'] = datadf['power'].astype('int')
|
||||||
datadf.loc[:,'spm'] = 10*datadf['spm'].astype('int')/10.
|
datadf.loc[:,'distance'] = datadf['distance'].astype('int')
|
||||||
|
datadf.loc[:,'spm'] = 10*datadf['spm'].astype('int')/10.
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = DataFrameColumnsForm(request.POST)
|
form = DataFrameColumnsForm(request.POST)
|
||||||
@@ -2987,9 +2991,12 @@ def workout_data_view(request, id=0):
|
|||||||
try:
|
try:
|
||||||
datadf = datadf[tcols]
|
datadf = datadf[tcols]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
tcols = list(set(datadf.columns(tolist)+tcols))
|
# tcols = list(set(datadf.columns(tolist)+tcols))
|
||||||
datadf = datadf[tcols]
|
try:
|
||||||
datadf = datadf.fillna(value=0)
|
datadf = datadf[tcols]
|
||||||
|
datadf = datadf.fillna(value=0)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
for col in cols:
|
for col in cols:
|
||||||
try:
|
try:
|
||||||
@@ -4068,7 +4075,9 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
|
|||||||
f1 = row.csvfilename
|
f1 = row.csvfilename
|
||||||
u = row.user.user
|
u = row.user.user
|
||||||
r = getrower(u)
|
r = getrower(u)
|
||||||
|
|
||||||
rowdata = rdata(f1)
|
rowdata = rdata(f1)
|
||||||
|
|
||||||
hascoordinates = 1
|
hascoordinates = 1
|
||||||
if rowdata != 0:
|
if rowdata != 0:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user