changed reading of non painsled to get better data
This commit is contained in:
@@ -1103,7 +1103,8 @@ def handle_nonpainsled(f2, fileformat, summary=''):
|
|||||||
# should delete file
|
# should delete file
|
||||||
f2 = f2[:-4] + 'o.csv'
|
f2 = f2[:-4] + 'o.csv'
|
||||||
try:
|
try:
|
||||||
row.write_csv(f2, gzip=True)
|
row2 = rrdata(df = row.df)
|
||||||
|
row2.write_csv(f2, gzip=True)
|
||||||
except:
|
except:
|
||||||
return (0,0,0,0)
|
return (0,0,0,0)
|
||||||
|
|
||||||
@@ -1718,7 +1719,7 @@ def smalldataprep(therows, xparam, yparam1, yparam2):
|
|||||||
f1 = workout.csvfilename
|
f1 = workout.csvfilename
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rowdata = dataprep(rrdata(f1).df)
|
rowdata = dataprep(rrdata(csvfile=f1).df)
|
||||||
|
|
||||||
rowdata = pd.DataFrame({xparam: rowdata[xparam],
|
rowdata = pd.DataFrame({xparam: rowdata[xparam],
|
||||||
yparam1: rowdata[yparam1],
|
yparam1: rowdata[yparam1],
|
||||||
@@ -1741,7 +1742,7 @@ 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:
|
||||||
try:
|
try:
|
||||||
rowdata = dataprep(rrdata(f1 + '.gz').df)
|
rowdata = dataprep(rrdata(csvfile=f1 + '.gz').df)
|
||||||
rowdata = pd.DataFrame({xparam: rowdata[xparam],
|
rowdata = pd.DataFrame({xparam: rowdata[xparam],
|
||||||
yparam1: rowdata[yparam1],
|
yparam1: rowdata[yparam1],
|
||||||
yparam2: rowdata[yparam2],
|
yparam2: rowdata[yparam2],
|
||||||
|
|||||||
@@ -617,10 +617,10 @@ def error403_view(request):
|
|||||||
# Checks for CSV file, then for gzipped CSV file, and if all fails, returns 0
|
# Checks for CSV file, then for gzipped CSV file, and if all fails, returns 0
|
||||||
def rdata(file,rower=rrower()):
|
def rdata(file,rower=rrower()):
|
||||||
try:
|
try:
|
||||||
res = rrdata(file,rower=rower)
|
res = rrdata(csvfile=file,rower=rower)
|
||||||
except IOError, IndexError:
|
except IOError, IndexError:
|
||||||
try:
|
try:
|
||||||
res = rrdata(file+'.gz',rower=rower)
|
res = rrdata(csvfile=file+'.gz',rower=rower)
|
||||||
except IOError, IndexError:
|
except IOError, IndexError:
|
||||||
res = 0
|
res = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user