Skip to content

Commit

Permalink
Update graphs.ipynb
Browse files Browse the repository at this point in the history
Fixed broken tex tables format with Python versions < 3.10
  • Loading branch information
marcocosta97 committed Sep 6, 2024
1 parent ca3011a commit 42d0ff7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions bench/scripts/graphs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,14 @@
"\n",
"def print_table(df_list, filename, space_em_list):\n",
" filled_sections = []\n",
" \n",
" filled_sections.append(\"\\\\begin{tabular}{rl}\")\n",
" for i, df in enumerate(df_list):\n",
" filled_sections.append(\"\\\\toprule\")\n",
" if i == 0:\n",
" table_string = df.to_latex(index=True, header=True, escape=False, column_format=\"rl\")\n",
" table_string = table_string.replace(\"{}\", \"Range filter\")\n",
" filled_sections.extend(table_string.split(\"\\n\")[:-2])\n",
" else:\n",
" table_string = df.to_latex(index=True, header=False, escape=False)\n",
" filled_sections.extend(table_string.split(\"\\n\")[1:-2])\n",
" \n",
" filled_sections.append(\"Range filter & Avg ns/query \\\\\\\\\")\n",
" filled_sections.append(\"\\\\midrule\")\n",
" table_string = df.to_latex(index=True, header=False, escape=False)\n",
" filled_sections.extend(table_string.split(\"\\n\")[3:-2]) \n",
" filled_sections.append(\"\\\\vspace{\" + space_em_list[i] + \"}\\\\\\\\\")\n",
" \n",
" filled_sections.append(\"\\\\end{tabular}\")\n",
Expand Down

0 comments on commit 42d0ff7

Please sign in to comment.