Private
Public Access
1
0

removing debug stuff

This commit is contained in:
Sander Roosendaal
2021-08-04 18:27:40 +02:00
parent 4b65cbf483
commit f16e92fabd
2 changed files with 16 additions and 0 deletions

View File

@@ -1601,6 +1601,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
powerperc=powerperc, powerzones=r.powerzones)
row = rdata(f2, rower=rr)
startdatetime,startdate,starttime,timezone_str,partofday = get_startdate_time_zone(r,row,startdatetime=startdatetime)
@@ -1975,11 +1976,15 @@ def handle_nonpainsled(f2, fileformat, summary='',startdatetime='',empowerfirmwa
f_to_be_deleted = f2
# should delete file
f2 = f2[:-4] + 'o.csv'
row2 = rrdata(df = row.df)
if 'speedcoach2' in fileformat or 'nklinklogbook' in fileformat:
# impeller consistency
impellerdata, consistent, ratio = row.impellerconsistent(threshold=0.3)
if impellerdata and consistent:
impeller = True
if impellerdata and not consistent:
@@ -1990,6 +1995,7 @@ def handle_nonpainsled(f2, fileformat, summary='',startdatetime='',empowerfirmwa
row2.write_csv(f2, gzip=True)
# os.remove(f2)
try:
os.remove(f_to_be_deleted)
@@ -2189,6 +2195,8 @@ def new_workout_from_file(r, f2,
dosummary = (fileformat != 'fit' and 'speedcoach2' not in fileformat)
dosummary = dosummary or summary == ''
@@ -2384,6 +2392,8 @@ def new_workout_from_df(r, df,
df['TimeStamp (sec)'] = df['TimeStamp (sec)'] + starttimeunix
row = rrdata(df=df)
row.write_csv(csvfilename, gzip=True)
# res = df.to_csv(csvfilename+'.gz',index_label='index',
@@ -2427,6 +2437,7 @@ def rdata(file, rower=rrower()):
except: # pragma: no cover
res = rrdata()
return res
# Remove all stroke data for workout ID from database
@@ -2535,6 +2546,7 @@ def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,comput
else:
try:
df = pd.read_parquet(csvfilenames[0],columns=columns)
rowdata, row = getrowdata(id=ids[0])
except (OSError,ArrowInvalid,IndexError):
rowdata,row = getrowdata(id=ids[0])
if rowdata and len(rowdata.df): # pragma: no cover

View File

@@ -5385,6 +5385,7 @@ def interactive_flex_chart2(id,r,promember=0,
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
workstrokesonly=workstrokesonly)
if r.usersmooth > 1: # pragma: no cover
for column in columns:
try:
@@ -5438,6 +5439,8 @@ def interactive_flex_chart2(id,r,promember=0,
# replace nans
rowdata.fillna(value=0,inplace=True)
row = Workout.objects.get(id=id)
if rowdata.empty:
return "","No valid data",'','',workstrokesonly
@@ -5508,6 +5511,7 @@ def interactive_flex_chart2(id,r,promember=0,
y1mean = rowdata['y1'].mean()
y2mean = rowdata['y2'].mean()
if xparam != 'time':
xvals = xaxmin+np.arange(100)*(xaxmax-xaxmin)/100.
else: