From fb5e0d38a821c921cf2f1c446b5a4cdcb969df67 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 14 Mar 2019 08:24:47 +0100 Subject: [PATCH] fixed c2 export --- .#data.txt | 1 + data.txt | 2 +- rowers/c2stuff.py | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .#data.txt diff --git a/.#data.txt b/.#data.txt new file mode 100644 index 00000000..b96304cb --- /dev/null +++ b/.#data.txt @@ -0,0 +1 @@ +E408191@CZ27LT9RCGN72.21200:1552461005 \ No newline at end of file diff --git a/data.txt b/data.txt index de83340c..dcd92711 100644 --- a/data.txt +++ b/data.txt @@ -1 +1 @@ -{"distance": 13878, "user_id": 457764, "ranked": false, "weight_class": "L", "verified": false, "workout_type": false, "comments": "\n from speedcoach2v2.15 via rowsandall.com", "heart_rate": {"max": 158, "average": 156}, "source": "rowingdata", "date_utc": "2018-06-30 05:31:01", "time_formatted": "1:21:16.7", "time": 48767, "date": "2018-06-30 07:31:01", "timezone": "Europe/Prague", "type": "water", "id": 33991243, "stroke_data": true} \ No newline at end of file +{"type": "rower", "date": "2019-01-24T18:53:44+00:00", "timezone": "Europe/Prague", "distance": 329, "time": 602, "weight_class": "H", "comments": "", "heart_rate": {"average": 109, "max": 120}, "stroke_data": [{"t": 27.899999618530273, "d": 359.0, "p": 933.353341316, "spm": 45, "hr": 86}, {"t": 27.899999618530273, "d": 359.0, "p": 896.8130644629998, "spm": 45, "hr": 87}, {"t": 131.09999895095825, "d": 945.0, "p": 887.3273670370002, "spm": 41, "hr": 96}, {"t": 150.89999914169312, "d": 1057.0, "p": 888.8512749680001, "spm": 41, "hr": 99}, {"t": 189.00000095367432, "d": 1272.0, "p": 893.321135635, "spm": 41, "hr": 104}, {"t": 231.60000085830688, "d": 1511.0, "p": 898.551793278, "spm": 41, "hr": 110}, {"t": 261.6000008583069, "d": 1678.0, "p": 902.543654733, "spm": 41, "hr": 112}, {"t": 291.3000011444092, "d": 1843.0, "p": 904.218616118, "spm": 40, "hr": 113}, {"t": 320.5999994277954, "d": 2005.0, "p": 906.500788185, "spm": 41, "hr": 115}, {"t": 350.09999990463257, "d": 2168.0, "p": 911.279484016, "spm": 41, "hr": 116}, {"t": 380.09999990463257, "d": 2332.0, "p": 916.9759463290001, "spm": 40, "hr": 117}, {"t": 424.20000076293945, "d": 2572.0, "p": 921.134398402, "spm": 41, "hr": 118}, {"t": 452.1000003814697, "d": 2724.0, "p": 922.692356183, "spm": 43, "hr": 118}, {"t": 481.1999988555908, "d": 2882.0, "p": 924.5055142540001, "spm": 42, "hr": 119}, {"t": 510.8999991416931, "d": 3042.0, "p": 930.1074368030002, "spm": 41, "hr": 119}, {"t": 540.2999997138977, "d": 3199.0, "p": 940.5537509750001, "spm": 41, "hr": 119}, {"t": 560.5999994277954, "d": 3293.0, "p": 953.788974501, "spm": 40, "hr": 120}]} \ No newline at end of file diff --git a/rowers/c2stuff.py b/rowers/c2stuff.py index 37154a38..ebe1d45b 100644 --- a/rowers/c2stuff.py +++ b/rowers/c2stuff.py @@ -17,6 +17,7 @@ from rowers.mytypes import otwtypes from iso8601 import ParseError import numpy +import json from rowsandall_app.settings import ( C2_CLIENT_ID, C2_REDIRECT_URI, C2_CLIENT_SECRET @@ -415,9 +416,10 @@ def createc2workoutdata(w): p = np.clip(p,0,3600) if w.workouttype == 'bike': p = 2.0*p - # t = t.astype(int) - # d = d.astype(int) - # p = p.astype(int) + + t = t.astype(int) + d = d.astype(int) + p = p.astype(int) spm = row.df[' Cadence (stokes/min)'].astype(int) spm[0] = spm[1] try: