added lbs/N force unit to model, use that
This commit is contained in:
@@ -1172,9 +1172,6 @@ def getrowdata_db(id=0,doclean=False,convertnewtons=True):
|
|||||||
if doclean:
|
if doclean:
|
||||||
data = clean_df_stats(data,ignorehr=True)
|
data = clean_df_stats(data,ignorehr=True)
|
||||||
|
|
||||||
# these two lines seem redundant ??
|
|
||||||
#data['averageforce'] = data['averageforce']
|
|
||||||
#data['peakforce'] = data['peakforce']
|
|
||||||
|
|
||||||
return data,row
|
return data,row
|
||||||
|
|
||||||
@@ -1420,16 +1417,7 @@ def datafusion(id1,id2,columns,offset):
|
|||||||
df2 = getsmallrowdata_db(['time']+columns,ids=[id2],doclean=False)
|
df2 = getsmallrowdata_db(['time']+columns,ids=[id2],doclean=False)
|
||||||
|
|
||||||
forceunit = 'N'
|
forceunit = 'N'
|
||||||
# set Force to same units
|
|
||||||
if 'averageforce' in columns or 'peakforce' in columns:
|
|
||||||
forceunit = workout2.forceunit
|
|
||||||
if workout1.forceunit == 'lbs' and workout2.forceunit == 'N':
|
|
||||||
df1['averageforce'] *= lbstoN
|
|
||||||
df1['peakforce'] *= lbstoN
|
|
||||||
if workout1.forceunit == 'N' and workout2.forceunit == 'lbs':
|
|
||||||
df1['averageforce'] /= lbstoN
|
|
||||||
df1['peakforce'] /= lbstoN
|
|
||||||
|
|
||||||
offsetmillisecs = offset.seconds*1000+offset.microseconds/1000.
|
offsetmillisecs = offset.seconds*1000+offset.microseconds/1000.
|
||||||
offsetmillisecs += offset.days*(3600*24*1000)
|
offsetmillisecs += offset.days*(3600*24*1000)
|
||||||
df2['time'] = df2['time']+offsetmillisecs
|
df2['time'] = df2['time']+offsetmillisecs
|
||||||
@@ -1460,7 +1448,7 @@ def datafusion(id1,id2,columns,offset):
|
|||||||
df['pace'] = df['pace']/1000.
|
df['pace'] = df['pace']/1000.
|
||||||
df['cum_dist'] = df['cumdist']
|
df['cum_dist'] = df['cumdist']
|
||||||
|
|
||||||
return df
|
return df,forceunit
|
||||||
|
|
||||||
def fix_newtons(id=0,limit=3000):
|
def fix_newtons(id=0,limit=3000):
|
||||||
# rowdata,row = getrowdata_db(id=id,doclean=False,convertnewtons=False)
|
# rowdata,row = getrowdata_db(id=id,doclean=False,convertnewtons=False)
|
||||||
|
|||||||
@@ -8393,11 +8393,13 @@ def workout_fusion_view(request,id1=0,id2=1):
|
|||||||
timeoffset = -timeoffset
|
timeoffset = -timeoffset
|
||||||
|
|
||||||
# Create DataFrame
|
# Create DataFrame
|
||||||
df = dataprep.datafusion(id1,id2,columns,timeoffset)
|
df,forceunit = dataprep.datafusion(id1,id2,columns,timeoffset)
|
||||||
|
|
||||||
|
|
||||||
idnew,message = dataprep.new_workout_from_df(r,df,
|
idnew,message = dataprep.new_workout_from_df(r,df,
|
||||||
title='Fused data',
|
title='Fused data',
|
||||||
parent=w1)
|
parent=w1,
|
||||||
|
forceunit=forceunit)
|
||||||
if message != None:
|
if message != None:
|
||||||
messages.error(request,message)
|
messages.error(request,message)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user