removing debug stuff
This commit is contained in:
@@ -1601,6 +1601,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
powerperc=powerperc, powerzones=r.powerzones)
|
powerperc=powerperc, powerzones=r.powerzones)
|
||||||
row = rdata(f2, rower=rr)
|
row = rdata(f2, rower=rr)
|
||||||
|
|
||||||
|
|
||||||
startdatetime,startdate,starttime,timezone_str,partofday = get_startdate_time_zone(r,row,startdatetime=startdatetime)
|
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
|
f_to_be_deleted = f2
|
||||||
# should delete file
|
# should delete file
|
||||||
f2 = f2[:-4] + 'o.csv'
|
f2 = f2[:-4] + 'o.csv'
|
||||||
|
|
||||||
row2 = rrdata(df = row.df)
|
row2 = rrdata(df = row.df)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if 'speedcoach2' in fileformat or 'nklinklogbook' in fileformat:
|
if 'speedcoach2' in fileformat or 'nklinklogbook' in fileformat:
|
||||||
# impeller consistency
|
# impeller consistency
|
||||||
impellerdata, consistent, ratio = row.impellerconsistent(threshold=0.3)
|
impellerdata, consistent, ratio = row.impellerconsistent(threshold=0.3)
|
||||||
|
|
||||||
if impellerdata and consistent:
|
if impellerdata and consistent:
|
||||||
impeller = True
|
impeller = True
|
||||||
if impellerdata and not consistent:
|
if impellerdata and not consistent:
|
||||||
@@ -1990,6 +1995,7 @@ def handle_nonpainsled(f2, fileformat, summary='',startdatetime='',empowerfirmwa
|
|||||||
row2.write_csv(f2, gzip=True)
|
row2.write_csv(f2, gzip=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# os.remove(f2)
|
# os.remove(f2)
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted)
|
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 = (fileformat != 'fit' and 'speedcoach2' not in fileformat)
|
||||||
dosummary = dosummary or summary == ''
|
dosummary = dosummary or summary == ''
|
||||||
|
|
||||||
@@ -2384,6 +2392,8 @@ def new_workout_from_df(r, df,
|
|||||||
df['TimeStamp (sec)'] = df['TimeStamp (sec)'] + starttimeunix
|
df['TimeStamp (sec)'] = df['TimeStamp (sec)'] + starttimeunix
|
||||||
|
|
||||||
row = rrdata(df=df)
|
row = rrdata(df=df)
|
||||||
|
|
||||||
|
|
||||||
row.write_csv(csvfilename, gzip=True)
|
row.write_csv(csvfilename, gzip=True)
|
||||||
|
|
||||||
# res = df.to_csv(csvfilename+'.gz',index_label='index',
|
# res = df.to_csv(csvfilename+'.gz',index_label='index',
|
||||||
@@ -2427,6 +2437,7 @@ def rdata(file, rower=rrower()):
|
|||||||
except: # pragma: no cover
|
except: # pragma: no cover
|
||||||
res = rrdata()
|
res = rrdata()
|
||||||
|
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
# Remove all stroke data for workout ID from database
|
# Remove all stroke data for workout ID from database
|
||||||
@@ -2535,6 +2546,7 @@ def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,comput
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
df = pd.read_parquet(csvfilenames[0],columns=columns)
|
df = pd.read_parquet(csvfilenames[0],columns=columns)
|
||||||
|
rowdata, row = getrowdata(id=ids[0])
|
||||||
except (OSError,ArrowInvalid,IndexError):
|
except (OSError,ArrowInvalid,IndexError):
|
||||||
rowdata,row = getrowdata(id=ids[0])
|
rowdata,row = getrowdata(id=ids[0])
|
||||||
if rowdata and len(rowdata.df): # pragma: no cover
|
if rowdata and len(rowdata.df): # pragma: no cover
|
||||||
|
|||||||
@@ -5385,6 +5385,7 @@ def interactive_flex_chart2(id,r,promember=0,
|
|||||||
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
||||||
workstrokesonly=workstrokesonly)
|
workstrokesonly=workstrokesonly)
|
||||||
|
|
||||||
|
|
||||||
if r.usersmooth > 1: # pragma: no cover
|
if r.usersmooth > 1: # pragma: no cover
|
||||||
for column in columns:
|
for column in columns:
|
||||||
try:
|
try:
|
||||||
@@ -5438,6 +5439,8 @@ def interactive_flex_chart2(id,r,promember=0,
|
|||||||
# replace nans
|
# replace nans
|
||||||
rowdata.fillna(value=0,inplace=True)
|
rowdata.fillna(value=0,inplace=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
row = Workout.objects.get(id=id)
|
row = Workout.objects.get(id=id)
|
||||||
if rowdata.empty:
|
if rowdata.empty:
|
||||||
return "","No valid data",'','',workstrokesonly
|
return "","No valid data",'','',workstrokesonly
|
||||||
@@ -5508,6 +5511,7 @@ def interactive_flex_chart2(id,r,promember=0,
|
|||||||
y1mean = rowdata['y1'].mean()
|
y1mean = rowdata['y1'].mean()
|
||||||
y2mean = rowdata['y2'].mean()
|
y2mean = rowdata['y2'].mean()
|
||||||
|
|
||||||
|
|
||||||
if xparam != 'time':
|
if xparam != 'time':
|
||||||
xvals = xaxmin+np.arange(100)*(xaxmax-xaxmin)/100.
|
xvals = xaxmin+np.arange(100)*(xaxmax-xaxmin)/100.
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user