fix
This commit is contained in:
@@ -1853,7 +1853,11 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True,
|
|||||||
|
|
||||||
filename = 'media/strokedata_{id}.parquet.gz'.format(id=id)
|
filename = 'media/strokedata_{id}.parquet.gz'.format(id=id)
|
||||||
df = dd.from_pandas(data, npartitions=1)
|
df = dd.from_pandas(data, npartitions=1)
|
||||||
df.to_parquet(filename, engine='fastparquet', compression='GZIP')
|
try:
|
||||||
|
df.to_parquet(filename, engine='fastparquet', compression='GZIP')
|
||||||
|
except FileNotFoundError:
|
||||||
|
df2 = dd.from_pandas(df, npartitions=1)
|
||||||
|
df2.to_parquet(filename, engine='fastparquet', compression='GZIP')
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|||||||
@@ -165,6 +165,8 @@ class C2Integration(SyncIntegration):
|
|||||||
row = rowingdata(csvfile=filename)
|
row = rowingdata(csvfile=filename)
|
||||||
except IOError: # pragma: no cover
|
except IOError: # pragma: no cover
|
||||||
return 0
|
return 0
|
||||||
|
except:
|
||||||
|
return 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
averagehr = int(row.df[' HRCur (bpm)'].mean())
|
averagehr = int(row.df[' HRCur (bpm)'].mean())
|
||||||
|
|||||||
@@ -351,10 +351,13 @@ def uploadactivity(access_token, filename, description='',
|
|||||||
name='Rowsandall.com workout'):
|
name='Rowsandall.com workout'):
|
||||||
|
|
||||||
data_gz = BytesIO()
|
data_gz = BytesIO()
|
||||||
with open(filename, 'rb') as inF:
|
try:
|
||||||
s = inF.read()
|
with open(filename, 'rb') as inF:
|
||||||
with gzip.GzipFile(fileobj=data_gz, mode="w") as gzf:
|
s = inF.read()
|
||||||
gzf.write(s)
|
with gzip.GzipFile(fileobj=data_gz, mode="w") as gzf:
|
||||||
|
gzf.write(s)
|
||||||
|
except FileNotFoundError:
|
||||||
|
return 0
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user