Skip to content

Commit 61f57af

Browse files
AlexanderSchultheissibbem
authored andcommitted
Updated plotting
1 parent c25cb4d commit 61f57af

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

plotting/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
commit_runtime.pdf
2-
commit_runtime.png
2+
commit_runtime.png
3+
/runtime_histogram.pdf
4+
/runtime_histogram.png

plotting/plot.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ def commit_runtime(runtime_results: [], annotate=False):
5555

5656
# Add annotation
5757
if annotate:
58-
ax.annotate(f'{runtimes_below_one:,.0f} commits require\nless than one minute.', xy=(0, runtimes_below_one),
58+
percentage = 100 * runtimes_below_one / len(runtimes)
59+
ax.annotate(f'{runtimes_below_one:,.0f} commits require\nless than one minute ({percentage:,.2f}%).', xy=(0, runtimes_below_one),
5960
xytext=(5, 40_000),
6061
arrowprops=dict(arrowstyle="->"),
6162
bbox=dict(boxstyle="round", fc="w"),
6263
fontsize=text_box_font_size
6364
)
6465

65-
ax.annotate(f'Two commits require\n{runtime_max:,.0f} minutes.', xy=(runtime_max, 2),
66+
percentage = 100 * runtime_max / len(runtimes)
67+
ax.annotate(f'Two commits require\n{runtime_max:,.0f} minutes ({percentage:,.2f}%).', xy=(runtime_max, 2),
6668
xytext=(runtime_max - 30, 10),
6769
arrowprops=dict(arrowstyle="->"),
6870
bbox=dict(boxstyle="round", fc="w"),
@@ -81,10 +83,11 @@ def major_formatter(x, pos):
8183

8284
# For debugging
8385
if __name__ == "__main__":
86+
# folder = "/data/m2/edit-patterns/results/"
8487
folder = "../results"
8588
print("Loading results...")
8689
results = load_runtime_results(folder)
8790
print("Plotting runtime histogram...")
88-
# commit_runtime(results, True)
89-
commit_runtime(results)
91+
commit_runtime(results, True)
92+
# commit_runtime(results)
9093
print("Done.")

0 commit comments

Comments
 (0)