Private
Public Access
1
0
This commit is contained in:
2024-10-31 09:06:37 +01:00
parent 108e34315c
commit a80c523c3b
3 changed files with 7 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ from polars.exceptions import (
ColumnNotFoundError, SchemaError, ComputeError,
InvalidOperationError, ShapeError
)
from pandas.errors import IntCastingNaNError
from rowingdata import (
KinoMapParser,
@@ -257,7 +258,10 @@ def get_video_data(w, groups=['basic'], mode='water'):
df2 = pd.concat([df2, coordinates], axis=1)
latitude = df2['latitude']
longitude = df2['longitude']
try:
boatspeed = (100*df2['velo'].fillna(method='ffill').fillna(method='bfill')).astype(int)/100.
except IntCastingNaNError:
boatspeed = 0.0*df2['longitude']
# bundle data
data = {
'boatspeed': boatspeed.values.tolist(),

Binary file not shown.

View File

@@ -418,6 +418,8 @@ def trendflexdata(workouts, options, userid=0):
return ('', 'Error: not enough data')
except TypeError:
return ('','Error: something wrong with the data')
except KeyError:
return ('','Error: no {groupby} data'.format(groupby=groupby))
else: # pragma: no cover
try:
bins = np.arange(datadf['days ago'].min()-binsize,