Merge branch 'release/v19.0.3'
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)
|
||||
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
|
||||
|
||||
|
||||
@@ -165,6 +165,8 @@ class C2Integration(SyncIntegration):
|
||||
row = rowingdata(csvfile=filename)
|
||||
except IOError: # pragma: no cover
|
||||
return 0
|
||||
except:
|
||||
return 0
|
||||
|
||||
try:
|
||||
averagehr = int(row.df[' HRCur (bpm)'].mean())
|
||||
|
||||
@@ -351,10 +351,13 @@ def uploadactivity(access_token, filename, description='',
|
||||
name='Rowsandall.com workout'):
|
||||
|
||||
data_gz = BytesIO()
|
||||
with open(filename, 'rb') as inF:
|
||||
s = inF.read()
|
||||
with gzip.GzipFile(fileobj=data_gz, mode="w") as gzf:
|
||||
gzf.write(s)
|
||||
try:
|
||||
with open(filename, 'rb') as inF:
|
||||
s = inF.read()
|
||||
with gzip.GzipFile(fileobj=data_gz, mode="w") as gzf:
|
||||
gzf.write(s)
|
||||
except FileNotFoundError:
|
||||
return 0
|
||||
|
||||
headers = {
|
||||
'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