Private
Public Access
1
0

changed reading of non painsled to get better data

This commit is contained in:
Sander Roosendaal
2017-11-27 10:39:15 +01:00
parent cf8d15cdca
commit dddbcad037
2 changed files with 6 additions and 5 deletions

View File

@@ -1103,7 +1103,8 @@ def handle_nonpainsled(f2, fileformat, summary=''):
# should delete file
f2 = f2[:-4] + 'o.csv'
try:
row.write_csv(f2, gzip=True)
row2 = rrdata(df = row.df)
row2.write_csv(f2, gzip=True)
except:
return (0,0,0,0)
@@ -1718,7 +1719,7 @@ def smalldataprep(therows, xparam, yparam1, yparam2):
f1 = workout.csvfilename
try:
rowdata = dataprep(rrdata(f1).df)
rowdata = dataprep(rrdata(csvfile=f1).df)
rowdata = pd.DataFrame({xparam: rowdata[xparam],
yparam1: rowdata[yparam1],
@@ -1741,7 +1742,7 @@ def smalldataprep(therows, xparam, yparam1, yparam2):
df = pd.concat([df, rowdata], ignore_index=True)
except IOError:
try:
rowdata = dataprep(rrdata(f1 + '.gz').df)
rowdata = dataprep(rrdata(csvfile=f1 + '.gz').df)
rowdata = pd.DataFrame({xparam: rowdata[xparam],
yparam1: rowdata[yparam1],
yparam2: rowdata[yparam2],

View File

@@ -617,10 +617,10 @@ def error403_view(request):
# Checks for CSV file, then for gzipped CSV file, and if all fails, returns 0
def rdata(file,rower=rrower()):
try:
res = rrdata(file,rower=rower)
res = rrdata(csvfile=file,rower=rower)
except IOError, IndexError:
try:
res = rrdata(file+'.gz',rower=rower)
res = rrdata(csvfile=file+'.gz',rower=rower)
except IOError, IndexError:
res = 0