From 1bec7ce805dc274825da80466f28ce6fa9b09fc0 Mon Sep 17 00:00:00 2001 From: geno Date: Fri, 7 Feb 2025 13:40:49 +0100 Subject: [PATCH] better table --- assets/table.tex | 81 ++++++++++++++++++++++++------------------------ test.py | 10 ++++-- 2 files changed, 48 insertions(+), 43 deletions(-) diff --git a/assets/table.tex b/assets/table.tex index 13ccd5d..2bf00ff 100644 --- a/assets/table.tex +++ b/assets/table.tex @@ -1,49 +1,50 @@ \begin{table}[h] \centering -\begin{tabular}{lccc} +\begin{tabular}{|c|c|c|c|c|c|c|} \hline Example & #Lines & #GV Nodes & #GV Edges & #Warnings & #Errors & Runtime \\ \hline -account & 23 & 19 & 27 & 0 & 2 & 0.208 \\ -dining & 31 & 29 & 44 & 0 & 2 & 0.242 \\ -hello & 24 & 3 & 3 & 2 & 0 & 0.186 \\ -async & 20 & 6 & 6 & 0 & 0 & 0.182 \\ -ticktackstop & 46 & 12 & 19 & 7 & 0 & 0.217 \\ -ticktackloop & 32 & 5 & 5 & 2 & 0 & 0.234 \\ -customer & 54 & 12 & 16 & 1 & 0 & 0.209 \\ -serverclient & 41 & 7 & 8 & 8 & 3 & 0.189 \\ -trick & 24 & 8 & 8 & 0 & 0 & 0.191 \\ -airline & 23 & 12 & 20 & 1 & 0 & 0.229 \\ -conditional-case & 26 & 10 & 15 & 1 & 16 & 0.205 \\ -for-loop-recursion & 18 & 8 & 9 & 0 & 0 & 0.191 \\ -function-call & 17 & 3 & 3 & 1 & 2 & 0.193 \\ -high-order-fun & 21 & 10 & 14 & 0 & 3 & 0.199 \\ -if-cases & 57 & 86 & 134 & 185 & 30 & 0.575 \\ -pass & 16 & 3 & 2 & 0 & 0 & 0.198 \\ -producer & 30 & 8 & 7 & 0 & 1 & 0.200 \\ -spawn & 22 & 9 & 8 & 0 & 0 & 0.200 \\ -unknown & 13 & 1 & 1 & 0 & 0 & 0.195 \\ -foo1 & 18 & 6 & 7 & 0 & 0 & 0.192 \\ -foo2 & 23 & 4 & 3 & 1 & 1 & 0.194 \\ -foo3 & 22 & 10 & 14 & 0 & 0 & 0.196 \\ -foo4 & 20 & 12 & 15 & 0 & 2 & 0.194 \\ -foo5 & 18 & 39 & 87 & 1 & 0 & 0.321 \\ -foo6 & 24 & 6 & 7 & 15 & 2 & 0.198 \\ -foo7 & 41 & 43 & 121 & 0 & 6 & 0.532 \\ -foo8 & 29 & 27 & 95 & 0 & 171 & 2.798 \\ -foo9 & 14 & 2 & 3 & 1 & 3 & 0.202 \\ -foo9b & 21 & 4 & 4 & 14 & 1 & 0.206 \\ -foo9c & 15 & 6 & 11 & 0 & 0 & 0.199 \\ -foo9d & 16 & 3 & 2 & 0 & 0 & 0.194 \\ -foo9e & 24 & 9 & 13 & 0 & 5 & 0.202 \\ -foo9f & 25 & 4 & 6 & 0 & 4 & 0.202 \\ -foo9g & 25 & 21 & 49 & 0 & 7 & 0.240 \\ -foo9h & 23 & 12 & 26 & 0 & 5 & 0.200 \\ -ping & 36 & 6 & 5 & 1 & 0 & 0.182 \\ -airline & 33 & 18 & 34 & 1 & 0 & 0.229 \\ -meViolation & 40 & 38 & 54 & 2 & 4 & 0.264 \\ -purchase & 47 & 25 & 44 & 6 & 0 & 0.257 \\ +account & 23 & 19 & 27 & 0 & 2 & 0.261s \\ +dining & 31 & 29 & 44 & 0 & 2 & 0.250s \\ +hello & 24 & 3 & 3 & 2 & 0 & 0.189s \\ +async & 20 & 6 & 6 & 0 & 0 & 0.188s \\ +ticktackstop & 46 & 12 & 19 & 7 & 0 & 0.210s \\ +ticktackloop & 32 & 5 & 5 & 2 & 0 & 0.184s \\ +customer & 54 & 12 & 16 & 1 & 0 & 0.209s \\ +serverclient & 41 & 7 & 8 & 8 & 3 & 0.193s \\ +trick & 24 & 8 & 8 & 0 & 0 & 0.185s \\ +airline & 23 & 12 & 20 & 1 & 0 & 0.225s \\ +conditional-case & 26 & 10 & 15 & 1 & 16 & 0.198s \\ +for-loop-recursion & 18 & 8 & 9 & 0 & 0 & 0.186s \\ +function-call & 17 & 3 & 3 & 1 & 2 & 0.184s \\ +high-order-fun & 21 & 10 & 14 & 0 & 3 & 0.193s \\ +if-cases & 57 & 86 & 134 & 185 & 30 & 0.543s \\ +pass & 16 & 3 & 2 & 0 & 0 & 0.196s \\ +producer & 30 & 8 & 7 & 0 & 1 & 0.198s \\ +spawn & 22 & 9 & 8 & 0 & 0 & 0.182s \\ +unknown & 13 & 1 & 1 & 0 & 0 & 0.187s \\ +foo1 & 18 & 6 & 7 & 0 & 0 & 0.215s \\ +foo2 & 23 & 4 & 3 & 1 & 1 & 0.190s \\ +foo3 & 22 & 10 & 14 & 0 & 0 & 0.195s \\ +foo4 & 20 & 12 & 15 & 0 & 2 & 0.194s \\ +foo5 & 18 & 39 & 87 & 1 & 0 & 0.317s \\ +foo6 & 24 & 6 & 7 & 15 & 2 & 0.200s \\ +foo7 & 41 & 43 & 121 & 0 & 6 & 0.520s \\ +foo8 & 29 & 27 & 95 & 0 & 171 & 2.893s \\ +foo9 & 14 & 2 & 3 & 1 & 3 & 0.191s \\ +foo9b & 21 & 4 & 4 & 14 & 1 & 0.188s \\ +foo9c & 15 & 6 & 11 & 0 & 0 & 0.198s \\ +foo9d & 16 & 3 & 2 & 0 & 0 & 0.186s \\ +foo9e & 24 & 9 & 13 & 0 & 5 & 0.193s \\ +foo9f & 25 & 4 & 6 & 0 & 4 & 0.193s \\ +foo9g & 25 & 21 & 49 & 0 & 7 & 0.231s \\ +foo9h & 23 & 12 & 26 & 0 & 5 & 0.196s \\ +ping & 36 & 6 & 5 & 1 & 0 & 0.183s \\ +airline & 33 & 18 & 34 & 1 & 0 & 0.225s \\ +meViolation & 40 & 38 & 54 & 2 & 4 & 0.255s \\ +purchase & 47 & 25 & 44 & 6 & 0 & 0.254s \\ \hline \end{tabular} \caption{Global view data} +\label{tab:gvbench} \end{table} \ No newline at end of file diff --git a/test.py b/test.py index 153f72d..11f1260 100755 --- a/test.py +++ b/test.py @@ -17,12 +17,16 @@ def read_csv_file(filepath): def generate_latex_table(columns, rows, caption): headers = " & ".join(columns) - table = "\\begin{table}[h]\n\\centering\n\\begin{tabular}{lccc}\n\\hline\n" + table = ( + "\\begin{table}[h]\n\\centering\n\\begin{tabular}{|" + + "c|" * len(columns) + + "}\n\\hline\n" + ) table += headers + " \\\\ \n\\hline\n" for row in rows: # print(row) table += " & ".join(row) + " \\\\ \n" - table += "\\hline\n\\end{tabular}\n\\caption{" + caption + "}\n\\end{table}" + table += "\\hline\n\\end{tabular}\n\\caption{" + caption + "}\n\\label{tab:gvbench}\n\\end{table}" return table @@ -92,7 +96,7 @@ def generate_latex_table(columns, rows, caption): add_data[item[3].rsplit("/", 1)[-1]] = { "warns": str(warns), "errs": str(errs), - "runtime": "{:.3f}".format(runtime), + "runtime": "{:.3f}s".format(runtime), } # print(f"{output}\ntime {runtime}\nwarns {warns}\nerrs {errs}") # time.sleep(1)