Merge branch 'develop' into feature/icu_sessions
This commit is contained in:
@@ -1648,10 +1648,14 @@ def read_data(columns, ids=[], doclean=True, workstrokesonly=True, debug=False,
|
||||
datadf = pl.concat(data)
|
||||
existing_columns = [col for col in columns if col in datadf.columns]
|
||||
datadf = datadf.select(existing_columns)
|
||||
except (ShapeError, SchemaError, ColumnNotFoundError):
|
||||
data = [
|
||||
df.select(columns)
|
||||
for df in data]
|
||||
except (ShapeError, SchemaError):
|
||||
try:
|
||||
data = [
|
||||
df.select(columns)
|
||||
for df in data]
|
||||
except ColumnNotFoundError:
|
||||
existing_columns = [col for col in columns if col in df.columns]
|
||||
df = df.select(existing_columns)
|
||||
|
||||
# float columns
|
||||
floatcolumns = []
|
||||
@@ -1686,14 +1690,19 @@ def read_data(columns, ids=[], doclean=True, workstrokesonly=True, debug=False,
|
||||
]
|
||||
except ComputeError:
|
||||
pass
|
||||
except ColumnNotFoundError:
|
||||
pass
|
||||
|
||||
try:
|
||||
datadf = pl.concat(data)
|
||||
except SchemaError:
|
||||
data = [
|
||||
df.with_columns(cs.integer().cast(pl.Float64)) for df in data
|
||||
]
|
||||
datadf = pl.concat(data)
|
||||
try:
|
||||
data = [
|
||||
df.with_columns(cs.integer().cast(pl.Float64)) for df in data
|
||||
]
|
||||
datadf = pl.concat(data)
|
||||
except ShapeError:
|
||||
return pl.DataFrame()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ from uuid import uuid4
|
||||
from django.utils import timezone
|
||||
from datetime import timedelta
|
||||
import rowers.dataprep as dataprep
|
||||
from rowers.opaque import encoder
|
||||
|
||||
from rowsandall_app.settings import (
|
||||
INTERVALS_CLIENT_ID, INTERVALS_REDIRECT_URI, INTERVALS_CLIENT_SECRET, SITE_URL
|
||||
@@ -171,6 +172,7 @@ class IntervalsIntegration(SyncIntegration):
|
||||
params = {
|
||||
'name': workout.name,
|
||||
'description': workout.notes,
|
||||
'external_id': encoder.encode_hex(workout.id),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -67,7 +67,10 @@ class TPIntegration(SyncIntegration):
|
||||
except TypeError:
|
||||
newnotes = 'from '+w.workoutsource+' via rowsandall.com'
|
||||
|
||||
row.exporttotcx(tcxfilename, notes=newnotes, sport=tpmapping[w.workouttype])
|
||||
try:
|
||||
row.exporttotcx(tcxfilename, notes=newnotes, sport=tpmapping[w.workouttype])
|
||||
except KeyError:
|
||||
row.exporttotcx(tcxfilename, notes=newnotes, sport='other')
|
||||
|
||||
return tcxfilename
|
||||
|
||||
|
||||
@@ -3741,7 +3741,8 @@ def handle_c2_async_workout(alldata, userid, c2token, c2id, delaysec,
|
||||
code=uuid4().hex[:16], c2id=c2id)
|
||||
|
||||
startdatetime, starttime, workoutdate, duration, starttimeunix, timezone = utils.get_startdatetime_from_c2data(
|
||||
data)
|
||||
data
|
||||
)
|
||||
|
||||
s = 'Time zone {timezone}, startdatetime {startdatetime}, duration {duration}'.format(
|
||||
timezone=timezone, startdatetime=startdatetime,
|
||||
@@ -3801,6 +3802,7 @@ def handle_c2_async_workout(alldata, userid, c2token, c2id, delaysec,
|
||||
strokelength = np.zeros(nr_rows)
|
||||
|
||||
dist2 = 0.1*strokedata.loc[:, 'd']
|
||||
cumdist, intervals = make_cumvalues(dist2)
|
||||
|
||||
try:
|
||||
spm = strokedata.loc[:, 'spm']
|
||||
@@ -3842,7 +3844,7 @@ def handle_c2_async_workout(alldata, userid, c2token, c2id, delaysec,
|
||||
' lapIdx': lapidx,
|
||||
' WorkoutState': 4,
|
||||
' ElapsedTime (sec)': seconds,
|
||||
'cum_dist': dist2
|
||||
'cum_dist': cumdist
|
||||
})
|
||||
|
||||
df.sort_values(by='TimeStamp (sec)', ascending=True)
|
||||
|
||||
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