diff contrib/perf-utils/perf-revlog-write-plot.py @ 43076:2372284d9457

formatting: blacken the codebase This is using my patch to black (https://github.com/psf/black/pull/826) so we don't un-wrap collection literals. Done with: hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions Differential Revision: https://phab.mercurial-scm.org/D6971
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:45:02 -0400
parents c3e5ce3a9483
children c102b704edb5
line wrap: on
line diff
--- a/contrib/perf-utils/perf-revlog-write-plot.py	Sat Oct 05 10:29:34 2019 -0400
+++ b/contrib/perf-utils/perf-revlog-write-plot.py	Sun Oct 06 09:45:02 2019 -0400
@@ -44,18 +44,12 @@
     comb_plt = fig.add_subplot(211)
     other_plt = fig.add_subplot(212)
 
-    comb_plt.plot(ary[0],
-                  np.cumsum(ary[1]),
-                  color='red',
-                  linewidth=1,
-                  label='comb')
+    comb_plt.plot(
+        ary[0], np.cumsum(ary[1]), color='red', linewidth=1, label='comb'
+    )
 
     plots = []
-    p = other_plt.plot(ary[0],
-                       ary[1],
-                       color='red',
-                       linewidth=1,
-                       label='wall')
+    p = other_plt.plot(ary[0], ary[1], color='red', linewidth=1, label='wall')
     plots.append(p)
 
     colors = {
@@ -64,20 +58,24 @@
         1000: ('purple', 'xkcd:dark pink'),
     }
     for n, color in colors.items():
-        avg_n = np.convolve(ary[1], np.full(n, 1. / n), 'valid')
-        p = other_plt.plot(ary[0][n - 1:],
-                           avg_n,
-                           color=color[0],
-                           linewidth=1,
-                           label='avg time last %d' % n)
+        avg_n = np.convolve(ary[1], np.full(n, 1.0 / n), 'valid')
+        p = other_plt.plot(
+            ary[0][n - 1 :],
+            avg_n,
+            color=color[0],
+            linewidth=1,
+            label='avg time last %d' % n,
+        )
         plots.append(p)
 
         med_n = scipy.signal.medfilt(ary[1], n + 1)
-        p = other_plt.plot(ary[0],
-                           med_n,
-                           color=color[1],
-                           linewidth=1,
-                           label='median time last %d' % n)
+        p = other_plt.plot(
+            ary[0],
+            med_n,
+            color=color[1],
+            linewidth=1,
+            label='median time last %d' % n,
+        )
         plots.append(p)
 
     formatter = mticker.ScalarFormatter()
@@ -108,6 +106,7 @@
         else:
             legline.set_alpha(0.2)
         fig.canvas.draw()
+
     if title is not None:
         fig.canvas.set_window_title(title)
     fig.canvas.mpl_connect('pick_event', onpick)