stanley-king 2 rokov pred
rodič
commit
a483b0a823

+ 3 - 1
plot/refill/ChannelCovPainter.py

@@ -35,9 +35,11 @@ class ChannelCovPainter(ChannelPainter):
         x = np.array([d - self._start_time for d in range(self._start_time, self._end_time)])
         window = np.ones(self._filter_wave)
 
+        split_len = self._start_time - _start_time
+
         chname_ratios = []
         for _chname, _card_type, _spec, _data in gen:
-            succ, count, y = calc_cov_chratios(_data, pos_map, _start_time - day_stamp, _end_time - day_stamp, window, self._start_time - day_stamp)
+            succ, count, y = calc_cov_chratios(_data, pos_map, _start_time - day_stamp, _end_time - day_stamp, window, split_len)
 
             label, ratio = self._label(chname=_chname, succ=succ, count=count, card_type=_card_type, spec=_spec)
             ax.plot(x, y, ls='-', label=label)

+ 4 - 3
plot/refill/algorithm.py

@@ -19,22 +19,23 @@ def calc_chratios(data, pos_map, start, end):
     y = y.ravel()
     return int(all[0, -1]), int(all[0, -1] + all[1, -1]), y
 
-def calc_cov_chratios(data, pos_map, start, end, window, split_pos):
+def calc_cov_chratios(data, pos_map, start, end, window, split_len):
     view = data[[pos_map.succ_count, pos_map.fail_count, pos_map.commit_count], :]
-    view = view[:, start:end]
 
+    sum_view = view[:, start + split_len:end]
     sums = np.sum(view, axis=1)
     succs = sums[0]
     fails = sums[1]
     commits = sums[2]
 
+    view = view[:, start:end]
     succ = view[0, :]
     fail = view[1, :]
     succ = np.convolve(succ, window, 'same')
     fail = np.convolve(fail, window, 'same')
     commit = succ + fail + 0.0000001
     y = succ / commit
-    y = y[split_pos - start:]
+    y = y[start + split_len:]
 
     return int(succs), int(succs + fails), y