diff --git a/analytics/models/drop_model.py b/analytics/models/drop_model.py index 1d25be3..ae214f3 100644 --- a/analytics/models/drop_model.py +++ b/analytics/models/drop_model.py @@ -60,7 +60,6 @@ class DropModel(Model): segment_median = ax_list[antipeaks_kde[0], 0] segment_min_line = ax_list[min_peak_index, 0] segment_max_line = ax_list[max_peak_index, 0] - #print(segment_min_line, segment_max_line) drop_height = 0.95 * (segment_max_line - segment_min_line) drop_height_list.append(drop_height) drop_length = utils.find_drop_length(segment_data, segment_min_line, segment_max_line) @@ -132,7 +131,7 @@ class DropModel(Model): delete_list.append(segment) for item in delete_list: segments.remove(item) - #print(segments) + for idrop in self.idrops: segments.append(idrop) diff --git a/analytics/models/peak_model.py b/analytics/models/peak_model.py index f27ed2e..06195d5 100644 --- a/analytics/models/peak_model.py +++ b/analytics/models/peak_model.py @@ -79,7 +79,7 @@ class PeakModel(Model): segments = [] for i in all_maxs: if all_max_flatten_data[i] > extrema_list[i]: - segments.append(i+12) + segments.append(i) filtered = self.__filter_prediction(segments, data) return [(dataframe['timestamp'][x - 1].value, dataframe['timestamp'][x + 1].value) for x in filtered] @@ -97,8 +97,7 @@ class PeakModel(Model): delete_list = [] if len(segments) == 0 or len(self.ipeaks) == 0: - segments = [] - return segments + return [] pattern_data = all_max_flatten_data[self.ipeaks[0] - WINDOW_SIZE: self.ipeaks[0] + WINDOW_SIZE] for segment in segments: diff --git a/analytics/models/trough_model.py b/analytics/models/trough_model.py index 929f2d4..8018acc 100644 --- a/analytics/models/trough_model.py +++ b/analytics/models/trough_model.py @@ -78,7 +78,7 @@ class TroughModel(Model): segments = [] for i in all_mins: if all_max_flatten_data[i] < extrema_list[i]: - segments.append(i + 12) + segments.append(i) filtered = self.__filter_prediction(segments, data) return [(dataframe['timestamp'][x - 1].value, dataframe['timestamp'][x + 1].value) for x in filtered]