tested
This commit is contained in:
@@ -394,7 +394,7 @@ def df_resample(datadf):
|
||||
|
||||
|
||||
def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
|
||||
ignoreadvanced=False):
|
||||
ignoreadvanced=False, for_chart=False):
|
||||
# clean data remove zeros and negative values
|
||||
|
||||
try:
|
||||
@@ -643,7 +643,8 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
|
||||
|
||||
after = {}
|
||||
|
||||
return datadf
|
||||
if for_chart:
|
||||
return datadf
|
||||
for workoutid in data_orig['workoutid'].unique():
|
||||
after[workoutid] = len(
|
||||
datadf[datadf['workoutid'] == workoutid].dropna())
|
||||
@@ -1212,7 +1213,7 @@ def testdata(time, distance, pace, spm): # pragma: no cover
|
||||
|
||||
|
||||
def getrowdata_db(id=0, doclean=False, convertnewtons=True,
|
||||
checkefficiency=True):
|
||||
checkefficiency=True, for_chart=False):
|
||||
data = read_df_sql(id)
|
||||
try:
|
||||
data['deltat'] = data['time'].diff()
|
||||
@@ -1237,7 +1238,7 @@ def getrowdata_db(id=0, doclean=False, convertnewtons=True,
|
||||
data = add_efficiency(id=id)
|
||||
|
||||
if doclean: # pragma: no cover
|
||||
data = clean_df_stats(data, ignorehr=True)
|
||||
data = clean_df_stats(data, ignorehr=True, for_chart=for_chart)
|
||||
|
||||
return data, row
|
||||
|
||||
@@ -1245,7 +1246,7 @@ def getrowdata_db(id=0, doclean=False, convertnewtons=True,
|
||||
|
||||
|
||||
def getsmallrowdata_db(columns, ids=[], doclean=True, workstrokesonly=True, compute=True,
|
||||
debug=False):
|
||||
debug=False, for_chart=False):
|
||||
# prepmultipledata(ids)
|
||||
|
||||
if ids:
|
||||
@@ -1312,7 +1313,8 @@ def getsmallrowdata_db(columns, ids=[], doclean=True, workstrokesonly=True, comp
|
||||
data = df.copy()
|
||||
if doclean:
|
||||
data = clean_df_stats(data, ignorehr=True,
|
||||
workstrokesonly=workstrokesonly)
|
||||
workstrokesonly=workstrokesonly,
|
||||
for_chart=for_chart)
|
||||
data.dropna(axis=1, how='all', inplace=True)
|
||||
data.dropna(axis=0, how='all', inplace=True)
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user