Private
Public Access
1
0

Merge tag 'v3.01' into develop

bug fix drivelength flex plot
This commit is contained in:
Sander Roosendaal
2017-05-23 20:25:04 +02:00
2 changed files with 9 additions and 3 deletions

View File

@@ -273,6 +273,7 @@ def clean_df_stats(datadf,workstrokesonly=True,ignorehr=True,
pass pass
try: try:
mask = datadf['catch'] > -30. mask = datadf['catch'] > -30.
datadf.loc[mask,'catch'] = np.nan datadf.loc[mask,'catch'] = np.nan
@@ -899,7 +900,7 @@ def getsmallrowdata_db(columns,ids=[],doclean=True,workstrokesonly=True,
convertnewtons=False): convertnewtons=False):
prepmultipledata(ids) prepmultipledata(ids)
data = read_cols_df_sql(ids,columns) data = read_cols_df_sql(ids,columns)
if convertnewtons: if convertnewtons:
if 'peakforce' in columns: if 'peakforce' in columns:
data['peakforce'] = data['peakforce']*lbstoN data['peakforce'] = data['peakforce']*lbstoN
@@ -910,6 +911,8 @@ def getsmallrowdata_db(columns,ids=[],doclean=True,workstrokesonly=True,
data = clean_df_stats(data,ignorehr=True, data = clean_df_stats(data,ignorehr=True,
workstrokesonly=workstrokesonly) workstrokesonly=workstrokesonly)
return data return data
# Fetch both the workout and the workout stroke data (from CSV file) # Fetch both the workout and the workout stroke data (from CSV file)
@@ -1228,6 +1231,7 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
) )
) )
if bands: if bands:
# HR bands # HR bands
data['hr_ut2'] = rowdatadf.ix[:,'hr_ut2'] data['hr_ut2'] = rowdatadf.ix[:,'hr_ut2']
@@ -1276,7 +1280,7 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
arclength = (inboard-0.05)*(np.radians(finish)-np.radians(catch)) arclength = (inboard-0.05)*(np.radians(finish)-np.radians(catch))
if arclength.mean()>0: if arclength.mean()>0:
drivelength = arclength drivelength = arclength
else: elif drivelength.mean() == 0:
drivelength = driveenergy/(averageforce*4.44822) drivelength = driveenergy/(averageforce*4.44822)
try: try:

View File

@@ -1390,6 +1390,7 @@ def interactive_flex_chart2(id=0,promember=0,
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True, rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
workstrokesonly=workstrokesonly) workstrokesonly=workstrokesonly)
try: try:
tests = rowdata[yparam2] tests = rowdata[yparam2]
except KeyError: except KeyError:
@@ -1442,7 +1443,8 @@ def interactive_flex_chart2(id=0,promember=0,
tseconds = rowdata.ix[:,'time'] tseconds = rowdata.ix[:,'time']
except KeyError: except KeyError:
return '','No time data - cannot make flex plot','','' return '','No time data - cannot make flex plot','',''
try: try:
rowdata['x1'] = rowdata.ix[:,xparam] rowdata['x1'] = rowdata.ix[:,xparam]
except KeyError: except KeyError: