From 76b757f19bbd39e220c8cfbd6abe27ccb7687107 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 31 Oct 2019 15:51:13 +0100 Subject: [PATCH 1/2] bug fix --- rowers/dataprep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 2c15a5a2..e62498b1 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -2007,9 +2007,9 @@ def read_df_sql(id): f = 'media/strokedata_{id}.parquet.gz'.format(id=id) df = pd.read_parquet(f) except OSError: - rowdata,row = getrowdata(id=ids[0]) + rowdata,row = getrowdata(id=id) if rowdata and len(rowdata.df): - data = dataprep(rowdata.df,id=ids[0],bands=True,otwpower=True,barchart=True) + data = dataprep(rowdata.df,id=id,bands=True,otwpower=True,barchart=True) df = pd.read_parquet(f) df = df.fillna(value=0) From 4bf967195f1d44601f4051b64f3796e78153d048 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 31 Oct 2019 16:01:10 +0100 Subject: [PATCH 2/2] corrected incorrect tabs --- rowers/tasks.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rowers/tasks.py b/rowers/tasks.py index ccc797aa..ab2c9261 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -130,8 +130,8 @@ def handle_c2_import_stroke_data(c2token, authorizationstring = str('Bearer ' + c2token) headers = {'Authorization': authorizationstring, - 'user-agent': 'sanderroosendaal', - 'Content-Type': 'application/json'} + 'user-agent': 'sanderroosendaal', + 'Content-Type': 'application/json'} url = "https://log.concept2.com/api/users/me/results/"+str(c2id)+"/strokes" s = requests.get(url,headers=headers) if s.status_code == 200: @@ -191,10 +191,10 @@ def getagegrouprecord(age,sex='male',weightcategory='hwt', distance=2000,duration=None,indf=pd.DataFrame()): if not duration: - try: - df = indf[indf['distance'] == distance] - except KeyError: - df = pd.DataFrame() + try: + df = indf[indf['distance'] == distance] + except KeyError: + df = pd.DataFrame() else: duration = 60*int(duration) df = indf[indf['duration'] == duration]