Private
Public Access
1
0
This commit is contained in:
2024-03-17 12:26:50 +01:00
parent bdaf5fada8
commit 1c4f6cc7ee
3 changed files with 14 additions and 12 deletions

View File

@@ -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