Merge branch 'hotfix/gzipped'
This commit is contained in:
@@ -118,7 +118,10 @@ def rdata(file,rower=rrower()):
|
|||||||
try:
|
try:
|
||||||
res = rrdata(file,rower=rower)
|
res = rrdata(file,rower=rower)
|
||||||
except IOError:
|
except IOError:
|
||||||
res = 0
|
try:
|
||||||
|
res = rrdata(file+'.gz',rower=rower)
|
||||||
|
except IOError:
|
||||||
|
res = 0
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@@ -280,7 +283,18 @@ def smalldataprep(therows,xparam,yparam1,yparam2):
|
|||||||
)
|
)
|
||||||
df = pd.concat([df,rowdata],ignore_index=True)
|
df = pd.concat([df,rowdata],ignore_index=True)
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
try:
|
||||||
|
rowdata = dataprep(rrdata(f1+'.gz').df)
|
||||||
|
rowdata = pd.DataFrame({xparam: rowdata[xparam],
|
||||||
|
yparam1: rowdata[yparam1],
|
||||||
|
yparam2: rowdata[yparam2],
|
||||||
|
'distance': rowdata['distance'],
|
||||||
|
'spm': rowdata['spm'],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
df = pd.concat([df,rowdata],ignore_index=True)
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,10 @@ def rdata(file,rower=rrower()):
|
|||||||
try:
|
try:
|
||||||
res = rrdata(file,rower=rower)
|
res = rrdata(file,rower=rower)
|
||||||
except IOError:
|
except IOError:
|
||||||
res = 0
|
try:
|
||||||
|
res = rrdata(file+'.gz',rower=rower)
|
||||||
|
except IOError:
|
||||||
|
res = 0
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@@ -220,7 +223,18 @@ def smalldataprep(therows,xparam,yparam1,yparam2):
|
|||||||
)
|
)
|
||||||
df = pd.concat([df,rowdata],ignore_index=True)
|
df = pd.concat([df,rowdata],ignore_index=True)
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
try:
|
||||||
|
rowdata = dataprep(rrdata(f1+'.gz').df)
|
||||||
|
rowdata = pd.DataFrame({xparam: rowdata[xparam],
|
||||||
|
yparam1: rowdata[yparam1],
|
||||||
|
yparam2: rowdata[yparam2],
|
||||||
|
'distance': rowdata['distance'],
|
||||||
|
'spm': rowdata['spm'],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
df = pd.concat([df,rowdata],ignore_index=True)
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ def rdata(file,rower=rrower()):
|
|||||||
try:
|
try:
|
||||||
res = rrdata(file,rower=rower)
|
res = rrdata(file,rower=rower)
|
||||||
except IOError:
|
except IOError:
|
||||||
res = 0
|
try:
|
||||||
|
res = rrdata(file+'.gz',rower=rower)
|
||||||
|
except IOError:
|
||||||
|
res = 0
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,11 @@ def handle_sendemailcsv(first_name,last_name,email,csvfile):
|
|||||||
def handle_otwsetpower(f1,boattype,weightvalue,
|
def handle_otwsetpower(f1,boattype,weightvalue,
|
||||||
first_name,last_name,email,workoutid,
|
first_name,last_name,email,workoutid,
|
||||||
debug=False):
|
debug=False):
|
||||||
rowdata = rdata(f1)
|
try:
|
||||||
|
rowdata = rdata(f1)
|
||||||
|
except IOError:
|
||||||
|
rowdata = rdata(f1+'.csv')
|
||||||
|
|
||||||
weightvalue = float(weightvalue)
|
weightvalue = float(weightvalue)
|
||||||
|
|
||||||
# do something with boat type
|
# do something with boat type
|
||||||
@@ -165,7 +169,11 @@ def handle_makeplot(f1,f2,t,hrdata,plotnr,imagename):
|
|||||||
rr = rowingdata.rower(hrmax=hrmax,hrut2=hrut2,
|
rr = rowingdata.rower(hrmax=hrmax,hrut2=hrut2,
|
||||||
hrut1=hrut1,hrat=hrat,
|
hrut1=hrut1,hrat=hrat,
|
||||||
hrtr=hrtr,hran=hran)
|
hrtr=hrtr,hran=hran)
|
||||||
row = rdata(f2,rower=rr)
|
try:
|
||||||
|
row = rdata(f2,rower=rr)
|
||||||
|
except IOError:
|
||||||
|
row = rdata(f2+'.gz',rower=rr)
|
||||||
|
|
||||||
nr_rows = len(row.df)
|
nr_rows = len(row.df)
|
||||||
if (plotnr in [1,2,4,5,8,11,9,12]) and (nr_rows > 1200):
|
if (plotnr in [1,2,4,5,8,11,9,12]) and (nr_rows > 1200):
|
||||||
bin = int(nr_rows/1200.)
|
bin = int(nr_rows/1200.)
|
||||||
|
|||||||
@@ -131,7 +131,10 @@ def rdata(file,rower=rrower()):
|
|||||||
try:
|
try:
|
||||||
res = rrdata(file,rower=rower)
|
res = rrdata(file,rower=rower)
|
||||||
except IOError:
|
except IOError:
|
||||||
res = 0
|
try:
|
||||||
|
res = rrdata(file+'.gz',rower=rower)
|
||||||
|
except IOError:
|
||||||
|
res = 0
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user