From 79ab50e29a3b61305600ffff14cf05a60b7f31e8 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 1 Jun 2017 16:19:56 +0200 Subject: [PATCH] no consistency checks on data fusion --- rowers/dataprep.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 9744c77a..18516db8 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -398,7 +398,8 @@ def save_workout_database(f2,r,dosmooth=True,workouttype='rower', notes='',totaldist=0,totaltime=0, summary='', makeprivate=False, - oarlength=2.89,inboard=0.88): + oarlength=2.89,inboard=0.88, + consistencychecks=True): message = None powerperc = 100*np.array([r.pw_ut2, r.pw_ut1, @@ -417,9 +418,12 @@ def save_workout_database(f2,r,dosmooth=True,workouttype='rower', for key,value in checks.iteritems(): if not value: allchecks = 0 - a_messages.error(r.user,'Failed consistency check: '+key+', autocorrected') + if consistencychecks: + a_messages.error(r.user,'Failed consistency check: '+key+', autocorrected') + else: + a_messages.error(r.user,'Failed consistency check: '+key+', not corrected') - if not allchecks: + if not allchecks and consistencychecks: row.repair() @@ -780,7 +784,8 @@ def new_workout_from_df(r,df, oarlength=oarlength, inboard=inboard, makeprivate=makeprivate, - dosmooth=False) + dosmooth=False, + consistencychecks=False) return (id,message)