From 08c090953802af2f40d34e74a6068a1b0fafd251 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ma=C3=ABl=20Madon?= <mael.madon@irit.fr>
Date: Fri, 30 Jun 2023 12:39:39 +0200
Subject: [PATCH] reformat latex table

---
 expe_replay_feedback_KTH.ipynb | 61 +++++++++++++++++++---------------
 1 file changed, 34 insertions(+), 27 deletions(-)

diff --git a/expe_replay_feedback_KTH.ipynb b/expe_replay_feedback_KTH.ipynb
index 9730e87..60cb908 100644
--- a/expe_replay_feedback_KTH.ipynb
+++ b/expe_replay_feedback_KTH.ipynb
@@ -14,7 +14,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 1,
+   "execution_count": 2,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -36,7 +36,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 2,
+   "execution_count": 3,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -1756,7 +1756,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 22,
+   "execution_count": 4,
    "metadata": {},
    "outputs": [
     {
@@ -2865,39 +2865,44 @@
     "    \"mean_waiting_time\",\"max_waiting_time\",\"mean_slowdown\",\"max_slowdown\",\"mean_turnaround_time\",\"max_turnaround_time\",\"nb_computing_machines\"]])\n",
     "\n",
     "print(\"Simulation results (with readable durations):\")\n",
-    "all = all.astype({\"simulation_time\":'timedelta64[s]',\"makespan\":'timedelta64[s]',\"length\":'timedelta64[s]',\"lateness\":'timedelta64[s]',\n",
+    "all_readable = all.astype({\"simulation_time\":'timedelta64[s]',\"makespan\":'timedelta64[s]',\"length\":'timedelta64[s]',\"lateness\":'timedelta64[s]',\n",
     "    \"mean_waiting_time\":'timedelta64[s]',\"max_waiting_time\":'timedelta64[s]',\"mean_turnaround_time\":'timedelta64[s]',\"max_turnaround_time\":'timedelta64[s]'})\n",
-    "display(all[[\"expe\", \"replay\", \"simulation_time\",\"makespan\",\"length\",\"lateness\",\"stretch\",\"delta\",\"nb_jobs\",\"nb_jobs_success\",\n",
+    "display(all_readable[[\"expe\", \"replay\", \"simulation_time\",\"makespan\",\"length\",\"lateness\",\"stretch\",\"delta\",\"nb_jobs\",\"nb_jobs_success\",\n",
     "    \"mean_waiting_time\",\"max_waiting_time\",\"mean_slowdown\",\"max_slowdown\",\"mean_turnaround_time\",\"max_turnaround_time\",\"nb_computing_machines\"]])"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 24,
+   "execution_count": 16,
    "metadata": {},
    "outputs": [
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "\\begin{tabular}{lrrrrrr}\n",
+      "\\begin{tabular}{llrrrrrr}\n",
       "\\toprule\n",
-      "    expe\\_name &          makespan &           lateness &  stretch &  delta & mean\\_waiting\\_time &  max\\_waiting\\_time \\\\\n",
+      "        expe & replay &  makespan & mean\\_waiting\\_time &  max\\_waiting\\_time &  lateness &  stretch &  delta \\\\\n",
       "\\midrule\n",
-      " original\\_log & 332 days 22:17:00 &    0 days 00:00:00 &      NaN &    NaN &   0 days 04:14:55 &  11 days 08:14:00 \\\\\n",
-      "   rigid\\_FCFS & 340 days 01:00:08 &    0 days 00:00:00 &     1.00 &   0.00 &   4 days 12:17:32 &  11 days 18:52:21 \\\\\n",
-      "   rigid\\_EASY & 339 days 20:33:46 &    0 days 00:00:00 &     1.00 &   0.00 &   0 days 01:35:50 &   4 days 01:47:30 \\\\\n",
-      "      a0\\_FCFS & 464 days 20:58:24 &   32 days 15:43:53 &     1.10 & 198.18 &   0 days 06:55:49 &   4 days 22:45:45 \\\\\n",
-      "      a0\\_EASY & 377 days 06:54:22 &  -4 days +19:12:51 &     0.99 & -19.42 &   0 days 01:25:41 &   4 days 10:01:18 \\\\\n",
-      "     a60\\_EASY & 373 days 18:45:41 &  -5 days +13:12:50 &     0.99 & -27.00 &   0 days 01:39:08 &   4 days 03:32:02 \\\\\n",
-      "rigid\\_speed*2 & 339 days 20:33:42 &    0 days 00:00:00 &     1.00 &   0.00 &   0 days 00:11:51 &   1 days 08:12:35 \\\\\n",
-      "rigid\\_speed/2 & 480 days 12:31:23 &    0 days 00:00:00 &     1.00 &   0.00 &  29 days 22:18:48 & 143 days 04:20:36 \\\\\n",
-      "   a0\\_speed*2 & 339 days 12:19:03 & -13 days +12:53:03 &     0.96 & -75.64 &   0 days 00:09:03 &   2 days 00:32:10 \\\\\n",
-      "   a0\\_speed/2 & 651 days 22:19:31 &   45 days 07:12:12 &     1.14 & 274.91 &   0 days 10:52:38 &  10 days 12:19:49 \\\\\n",
-      "rigid\\_infra*2 & 339 days 20:33:46 &    0 days 00:00:00 &     1.00 &   0.00 &   0 days 00:03:44 &   0 days 13:00:54 \\\\\n",
-      "rigid\\_infra/2 & 394 days 21:58:33 &    0 days 00:00:00 &     1.00 &   0.00 &   4 days 03:01:43 &  60 days 07:33:42 \\\\\n",
-      "   a0\\_infra*2 & 339 days 13:39:41 &  -9 days +08:33:51 &     0.97 & -52.45 &   0 days 00:02:35 &   0 days 15:06:28 \\\\\n",
-      "   a0\\_infra/2 & 482 days 15:45:49 &   16 days 23:25:23 &     1.05 & 103.02 &   0 days 06:29:25 &   7 days 09:43:31 \\\\\n",
+      "original\\_log &    NaN &    332.93 &   0 days 04:14:55 &  11 days 08:14:00 &      0.00 &      NaN &    NaN \\\\\n",
+      "        EASY &  rigid &    339.86 &   0 days 01:35:50 &   4 days 01:47:30 &      0.00 &     1.00 &   0.00 \\\\\n",
+      "        EASY &     a0 &    377.29 &   0 days 01:25:41 &   4 days 10:01:18 &     -3.20 &     0.99 & -19.42 \\\\\n",
+      "        EASY &    a60 &    373.78 &   0 days 01:39:08 &   4 days 03:32:02 &     -4.45 &     0.99 & -27.00 \\\\\n",
+      "        FCFS &  rigid &    340.04 &   4 days 12:17:32 &  11 days 18:52:21 &      0.00 &     1.00 &   0.00 \\\\\n",
+      "        FCFS &     a0 &    464.87 &   0 days 06:55:49 &   4 days 22:45:45 &     32.66 &     1.10 & 198.18 \\\\\n",
+      "        FCFS &    a60 &    461.39 &   0 days 11:18:17 &   4 days 11:19:01 &     26.31 &     1.08 & 159.64 \\\\\n",
+      "     speed*2 &  rigid &    339.86 &   0 days 00:11:51 &   1 days 08:12:35 &      0.00 &     1.00 &   0.00 \\\\\n",
+      "     speed*2 &     a0 &    339.51 &   0 days 00:09:03 &   2 days 00:32:10 &    -12.46 &     0.96 & -75.64 \\\\\n",
+      "     speed*2 &    a60 &    339.55 &   0 days 00:10:19 &   1 days 10:25:33 &    -13.28 &     0.96 & -80.61 \\\\\n",
+      "     speed/2 &  rigid &    480.52 &  29 days 22:18:48 & 143 days 04:20:36 &      0.00 &     1.00 &   0.00 \\\\\n",
+      "     speed/2 &     a0 &    651.93 &   0 days 10:52:38 &  10 days 12:19:49 &     45.30 &     1.14 & 274.91 \\\\\n",
+      "     speed/2 &    a60 &    638.37 &   0 days 13:39:40 &  11 days 04:15:54 &     42.22 &     1.13 & 256.21 \\\\\n",
+      "     infra*2 &  rigid &    339.86 &   0 days 00:03:44 &   0 days 13:00:54 &      0.00 &     1.00 &   0.00 \\\\\n",
+      "     infra*2 &     a0 &    339.57 &   0 days 00:02:35 &   0 days 15:06:28 &     -8.64 &     0.97 & -52.45 \\\\\n",
+      "     infra*2 &    a60 &    339.59 &   0 days 00:03:36 &   0 days 17:09:11 &     -9.29 &     0.97 & -56.37 \\\\\n",
+      "     infra/2 &  rigid &    394.92 &   4 days 03:01:43 &  60 days 07:33:42 &      0.00 &     1.00 &   0.00 \\\\\n",
+      "     infra/2 &     a0 &    482.66 &   0 days 06:29:25 &   7 days 09:43:31 &     16.98 &     1.05 & 103.02 \\\\\n",
+      "     infra/2 &    a60 &    480.54 &   0 days 08:34:29 &   7 days 12:27:43 &     14.87 &     1.04 &  90.26 \\\\\n",
       "\\bottomrule\n",
       "\\end{tabular}\n",
       "\n"
@@ -2907,15 +2912,17 @@
      "name": "stderr",
      "output_type": "stream",
      "text": [
-      "/run/user/1000/ipykernel_41067/1933710245.py:4: FutureWarning: In future versions `DataFrame.to_latex` is expected to utilise the base implementation of `Styler.to_latex` for formatting and rendering. The arguments signature may therefore change. It is recommended instead to use `DataFrame.style.to_latex` which also contains additional functionality.\n",
-      "  print(all.to_latex(columns=columns, index=False, escape=True,float_format=\"{:.2f}\".format))\n"
+      "/run/user/1000/ipykernel_18844/3088754662.py:5: FutureWarning: In future versions `DataFrame.to_latex` is expected to utilise the base implementation of `Styler.to_latex` for formatting and rendering. The arguments signature may therefore change. It is recommended instead to use `DataFrame.style.to_latex` which also contains additional functionality.\n",
+      "  print(to_latex.to_latex(columns=columns, index=False, escape=True,float_format=\"{:.2f}\".format))\n"
      ]
     }
    ],
    "source": [
-    "columns = [\"expe_name\", \"makespan\",\"lateness\", \"stretch\",\"delta\", \"mean_waiting_time\",\"max_waiting_time\"]\n",
-    "\n",
-    "print(all.to_latex(columns=columns, index=False, escape=True,float_format=\"{:.2f}\".format))\n"
+    "columns = [\"expe\", \"replay\", \"makespan\",\"mean_waiting_time\",\"max_waiting_time\",\"lateness\", \"stretch\",\"delta\"]\n",
+    "to_latex = all.astype({\"mean_waiting_time\":'timedelta64[s]',\"max_waiting_time\":'timedelta64[s]'})\n",
+    "to_latex[\"makespan\"] = to_latex.makespan / (3600*24)\n",
+    "to_latex[\"lateness\"] = to_latex.lateness / (3600*24)\n",
+    "print(to_latex.to_latex(columns=columns, index=False, escape=True,float_format=\"{:.2f}\".format))\n"
    ]
   },
   {
-- 
GitLab