fix
This commit is contained in:
@@ -2178,11 +2178,11 @@ def dataplep(rowdatadf, id=0, inboard=0.88, forceunit='lbs', bands=True, barchar
|
||||
df = df.with_columns((500./pl.col(' Stroke500mPace (sec/500m)')).alias(' AverageBoatSpeed (m/s)'))
|
||||
if ' WorkoutState' not in df.columns:
|
||||
df = df.with_columns((pl.lit(0)).alias(" WorkoutState"))
|
||||
if df[" DriveTime (ms)"].mean() > 0:
|
||||
if df[" DriveTime (ms)"].mean() is not None and df[" DriveTime (ms)"].mean() > 0:
|
||||
df = df.with_columns((100.*pl.col(" DriveTime (ms)")/(pl.col(" DriveTime (ms)")+pl.col(" StrokeRecoveryTime (ms)"))).alias("rhythm"))
|
||||
else:
|
||||
df = df.with_columns((pl.lit(0)).alias("rhythm"))
|
||||
if df[" PeakDriveForce (lbs)"].mean() > 0:
|
||||
if df[" PeakDriveForce (lbs)"].mean() is not None and df[" PeakDriveForce (lbs)"].mean() > 0:
|
||||
df = df.with_columns((pl.col(" AverageDriveForce (lbs)")/pl.col(" PeakDriveForce (lbs)")).alias("forceratio"))
|
||||
else:
|
||||
df = df.with_columns((pl.lit(0)).alias("forceratio"))
|
||||
|
||||
@@ -13,6 +13,7 @@ from json.decoder import JSONDecodeError
|
||||
|
||||
import ruptures as rpt
|
||||
from rowers.courses import getnearestcourses
|
||||
from pandas.errors import IntCastingNaNError
|
||||
|
||||
def default(o): # pragma: no cover
|
||||
if isinstance(o, numpy.int64):
|
||||
@@ -3451,7 +3452,7 @@ def workout_data_view(request, id=0):
|
||||
datadf.loc[:, 'power'] = datadf['power'].astype('int')
|
||||
datadf.loc[:, 'distance'] = datadf['distance'].astype('int')
|
||||
datadf.loc[:, 'spm'] = 10*datadf['spm'].astype('int')/10.
|
||||
except KeyError:
|
||||
except (KeyError, IntCastingNaNError):
|
||||
pass
|
||||
|
||||
if request.method == 'POST':
|
||||
|
||||
Reference in New Issue
Block a user