Private
Public Access
1
0

Merge branch 'release/v19.0.3'

This commit is contained in:
Sander Roosendaal
2023-06-13 08:08:55 +02:00
4 changed files with 14 additions and 5 deletions

View File

@@ -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

View File

@@ -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())

View File

@@ -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',

Binary file not shown.