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:
|
||||
data = clean_df_stats(data,ignorehr=True)
|
||||
|
||||
# these two lines seem redundant ??
|
||||
#data['averageforce'] = data['averageforce']
|
||||
#data['peakforce'] = data['peakforce']
|
||||
|
||||
return data,row
|
||||
|
||||
@@ -1420,16 +1417,7 @@ def datafusion(id1,id2,columns,offset):
|
||||
df2 = getsmallrowdata_db(['time']+columns,ids=[id2],doclean=False)
|
||||
|
||||
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.days*(3600*24*1000)
|
||||
df2['time'] = df2['time']+offsetmillisecs
|
||||
@@ -1460,7 +1448,7 @@ def datafusion(id1,id2,columns,offset):
|
||||
df['pace'] = df['pace']/1000.
|
||||
df['cum_dist'] = df['cumdist']
|
||||
|
||||
return df
|
||||
return df,forceunit
|
||||
|
||||
def fix_newtons(id=0,limit=3000):
|
||||
# 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
|
||||
|
||||
# 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,
|
||||
title='Fused data',
|
||||
parent=w1)
|
||||
parent=w1,
|
||||
forceunit=forceunit)
|
||||
if message != None:
|
||||
messages.error(request,message)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user