Browse Source

Minor fixes

pull/1/head
rozetko 6 years ago
parent
commit
2cd685114e
  1. 3
      analytics/models/drop_model.py
  2. 5
      analytics/models/peak_model.py
  3. 2
      analytics/models/trough_model.py

3
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)

5
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:

2
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]

Loading…
Cancel
Save