From 42d9b19a28c9c7fd8b4afed374a43e09fcf1ba2c Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 25 Oct 2017 16:22:36 +0200 Subject: [PATCH] removed redundant code --- rowers/dataprep.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/rowers/dataprep.py b/rowers/dataprep.py index f47df354..35e8b645 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -505,31 +505,8 @@ def fetchcp(rower,theworkouts): res = queue.enqueue(handle_updatecp,rower.id,theids) return [],[],avgpower2 - # below is redundant - thesecs = [] - for w in theworkouts: - timesecs = 3600*w.duration.hour - timesecs += 60*w.duration.minute - timesecs += w.duration.second - timesecs += 1.e-5*w.duration.microsecond - - thesecs.append(timesecs) - - if len(thesecs) != 0: - maxt = 1.05*pd.Series(thesecs).max() - else: - maxt = 1000. - - - logarr = datautils.getlogarr(maxt) - - - delta,cpvalue,avgpower = datautils.getcp(dfgrouped,logarr) - - updatecpdata_sql(rower.id,delta,cpvalue) - - return delta,cpvalue,avgpower2 + return [],[],avgpower2 # Processes painsled CSV file to database