Repository: dscc-admin-ch/lomas (language: python)

Issue:
Wip link
better display and info within tag link


Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index ca7a643c..be2cbc8e 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,6 @@
 [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
 [![Python](https://img.shields.io/badge/python-3.11-blue)](https://www.python.org/)
 [![Documentation](https://img.shields.io/badge/docs-Read%20the%20Docs-blue)](https://dscc-admin-ch.github.io/lomas-docs/index.html)
-
 [![Coverage badge](https://raw.githubusercontent.com/dscc-admin-ch/lomas/python-coverage-comment-action-data/badge.svg)](https://htmlpreview.github.io/?https://raw.githubusercontent.com/dscc-admin-ch/lomas/python-coverage-comment-action-data/htmlcov/index.html)
 
 
@@ -63,7 +62,3 @@ It is important to note that the service is not responsible for storing and mana
 
 ## History
 The starting point of our platform was the code shared to us by [Oblivious](https://www.oblivious.com/). They originally developed a client/server platform for the [UN PET Lab Hackathon 2022](https://petlab.officialstatistics.org/).
-
-## Test coverage
-
-For full test coverage information, see [here](https://htmlpreview.github.io/?https://github.com/dscc-admin-ch/lomas/blob/python-coverage-comment-action-data/htmlcov/index.html).
\ No newline at end of file
diff --git a/client/notebooks/Demo_Client_Notebook.ipynb b/client/notebooks/Demo_Client_Notebook.ipynb
index eebd10ee..46d87c0c 100644
--- a/client/notebooks/Demo_Client_Notebook.ipynb
+++ b/client/notebooks/Demo_Client_Notebook.ipynb
@@ -112,7 +112,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 8,
+   "execution_count": 4,
    "id": "941991f7",
    "metadata": {},
    "outputs": [],
@@ -153,7 +153,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 9,
+   "execution_count": 5,
    "id": "0fdebac9-57fc-4410-878b-5a77425af634",
    "metadata": {},
    "outputs": [
@@ -178,7 +178,7 @@
        "   'categories': ['MALE', 'FEMALE']}}}"
       ]
      },
-     "execution_count": 9,
+     "execution_count": 5,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -213,7 +213,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 10,
+   "execution_count": 6,
    "id": "01f4365a",
    "metadata": {},
    "outputs": [],
@@ -224,7 +224,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 11,
+   "execution_count": 7,
    "id": "3f553b29",
    "metadata": {},
    "outputs": [
@@ -336,7 +336,7 @@
        "4  5036.246870  FEMALE  "
       ]
      },
-     "execution_count": 11,
+     "execution_count": 7,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -391,7 +391,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 12,
+   "execution_count": 8,
    "id": "3946425d",
    "metadata": {},
    "outputs": [],
@@ -404,7 +404,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 13,
+   "execution_count": 9,
    "id": "90cf2a6d",
    "metadata": {},
    "outputs": [],
@@ -422,7 +422,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 14,
+   "execution_count": 10,
    "id": "a30f277e",
    "metadata": {},
    "outputs": [
@@ -430,7 +430,7 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "Average bill length in remote dummy: 47.51mm.\n",
+      "Average bill length in remote dummy: 47.52mm.\n",
       "Number of rows in remote dummy: 199.\n"
      ]
     }
@@ -461,7 +461,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 15,
+   "execution_count": 11,
    "id": "61a467f3",
    "metadata": {},
    "outputs": [
@@ -471,7 +471,7 @@
        "{'initial_epsilon': 10.0, 'initial_delta': 0.005}"
       ]
      },
-     "execution_count": 15,
+     "execution_count": 11,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -492,7 +492,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 16,
+   "execution_count": 12,
    "id": "afd22f84",
    "metadata": {},
    "outputs": [
@@ -502,7 +502,7 @@
        "{'total_spent_epsilon': 0.0, 'total_spent_delta': 0.0}"
       ]
      },
-     "execution_count": 16,
+     "execution_count": 12,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -521,7 +521,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 17,
+   "execution_count": 13,
    "id": "6260cf54",
    "metadata": {},
    "outputs": [
@@ -531,7 +531,7 @@
        "{'remaining_epsilon': 10.0, 'remaining_delta': 0.005}"
       ]
      },
-     "execution_count": 17,
+     "execution_count": 13,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -563,7 +563,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
+   "execution_count": 14,
    "id": "fd5ed08a",
    "metadata": {},
    "outputs": [],
@@ -574,7 +574,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 19,
+   "execution_count": 15,
    "id": "133020c6",
    "metadata": {},
    "outputs": [
@@ -584,7 +584,7 @@
        "{'epsilon_cost': 1.5, 'delta_cost': 0.00014999500000001387}"
       ]
      },
-     "execution_count": 19,
+     "execution_count": 15,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -618,7 +618,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 20,
+   "execution_count": 16,
    "id": "19e60263",
    "metadata": {},
    "outputs": [
@@ -628,7 +628,7 @@
        "{'remaining_epsilon': 10.0, 'remaining_delta': 0.005}"
       ]
      },
-     "execution_count": 20,
+     "execution_count": 16,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -639,7 +639,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 21,
+   "execution_count": 17,
    "id": "69767fac",
    "metadata": {},
    "outputs": [],
@@ -654,7 +654,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 22,
+   "execution_count": 18,
    "id": "6dbbdf93",
    "metadata": {},
    "outputs": [
@@ -663,7 +663,7 @@
      "output_type": "stream",
      "text": [
       "Number of penguins in real data: 344.\n",
-      "Average bill length of penguins in real data: 45.04mm.\n"
+      "Average bill length of penguins in real data: 43.79mm.\n"
      ]
     }
    ],
@@ -685,7 +685,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 23,
+   "execution_count": 19,
    "id": "4ced8a56-e2c3-4bd1-b94b-95cbbcd58a15",
    "metadata": {},
    "outputs": [
@@ -694,12 +694,12 @@
       "text/plain": [
        "{'requested_by': 'Dr. Antartica',\n",
        " 'query_response':    nb_penguins  avg_bill_length_mm\n",
-       " 0          344           45.043399,\n",
+       " 0          344           43.789627,\n",
        " 'spent_epsilon': 1.5,\n",
        " 'spent_delta': 0.00014999500000001387}"
       ]
      },
-     "execution_count": 23,
+     "execution_count": 19,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -710,7 +710,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 24,
+   "execution_count": 20,
    "id": "39701fe5",
    "metadata": {},
    "outputs": [
@@ -720,7 +720,7 @@
        "{'remaining_epsilon': 8.5, 'remaining_delta': 0.004850004999999986}"
       ]
      },
-     "execution_count": 24,
+     "execution_count": 20,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -739,7 +739,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 25,
+   "execution_count": 21,
    "id": "487f835f",
    "metadata": {},
    "outputs": [
@@ -749,7 +749,7 @@
        "{'total_spent_epsilon': 1.5, 'total_spent_delta': 0.00014999500000001387}"
       ]
      },
-     "execution_count": 25,
+     "execution_count": 21,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -776,7 +776,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 26,
+   "execution_count": 22,
    "id": "b9685226",
    "metadata": {},
    "outputs": [],
@@ -806,7 +806,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 27,
+   "execution_count": 23,
    "id": "4331d86f",
    "metadata": {},
    "outputs": [
@@ -831,7 +831,7 @@
        "   'categories': ['MALE', 'FEMALE']}}}"
       ]
      },
-     "execution_count": 27,
+     "execution_count": 23,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -850,7 +850,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 28,
+   "execution_count": 24,
    "id": "ff8cb7b6",
    "metadata": {},
    "outputs": [],
@@ -860,7 +860,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 29,
+   "execution_count": 25,
    "id": "70b2bdb1",
    "metadata": {},
    "outputs": [
@@ -870,7 +870,7 @@
        "(30.0, 65.0)"
       ]
      },
-     "execution_count": 29,
+     "execution_count": 25,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -891,7 +891,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 30,
+   "execution_count": 26,
    "id": "75e4933b",
    "metadata": {},
    "outputs": [],
@@ -916,7 +916,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 31,
+   "execution_count": 27,
    "id": "8041a647",
    "metadata": {},
    "outputs": [
@@ -946,7 +946,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 32,
+   "execution_count": 28,
    "id": "b8162859",
    "metadata": {},
    "outputs": [],
@@ -967,7 +967,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 33,
+   "execution_count": 29,
    "id": "df61bce0",
    "metadata": {},
    "outputs": [
@@ -975,7 +975,7 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "Dummy result for variance: 34.63\n"
+      "Dummy result for variance: 34.95\n"
      ]
     }
    ],
@@ -997,17 +997,17 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 28,
+   "execution_count": 30,
    "id": "7ae7f735",
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/plain": [
-       "{'epsilon_cost': 0.7163742690067888, 'delta_cost': 0}"
+       "{'epsilon_cost': 0.7122093023265229, 'delta_cost': 0}"
       ]
      },
-     "execution_count": 28,
+     "execution_count": 30,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1029,7 +1029,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 44,
+   "execution_count": 31,
    "id": "085555a5",
    "metadata": {},
    "outputs": [],
@@ -1041,7 +1041,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 35,
+   "execution_count": 32,
    "id": "674332e7",
    "metadata": {},
    "outputs": [
@@ -1050,8 +1050,8 @@
      "output_type": "stream",
      "text": [
       "Number of penguins: 344 (from previous smartnoise-sql query).\n",
-      "Average bill length: 45.04 (from previous smartnoise-sql query).\n",
-      "Variance of bill length: 33.325 (from opendp query).\n"
+      "Average bill length: 43.79 (from previous smartnoise-sql query).\n",
+      "Variance of bill length: 38.731 (from opendp query).\n"
      ]
     }
    ],
@@ -1074,7 +1074,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 37,
+   "execution_count": 33,
    "id": "f72b19d0",
    "metadata": {},
    "outputs": [
@@ -1082,7 +1082,7 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "Standard error of bill length: 0.31.\n"
+      "Standard error of bill length: 0.34.\n"
      ]
     }
    ],
@@ -1094,7 +1094,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 38,
+   "execution_count": 34,
    "id": "62630a03",
    "metadata": {},
    "outputs": [
@@ -1102,7 +1102,7 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "The 95% confidence interval of the bill length of all penguins is [44.43, 45.65].\n"
+      "The 95% confidence interval of the bill length of all penguins is [43.13, 44.45].\n"
      ]
     }
    ],
@@ -1134,7 +1134,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 39,
+   "execution_count": 35,
    "id": "558916a6-78a9-4589-abe8-41472f0c66d7",
    "metadata": {},
    "outputs": [
@@ -1144,7 +1144,7 @@
        "['Adelie', 'Chinstrap', 'Gentoo']"
       ]
      },
-     "execution_count": 39,
+     "execution_count": 35,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1164,7 +1164,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 40,
+   "execution_count": 36,
    "id": "505a2793-6750-4f2a-9a9d-09f3a4ae4099",
    "metadata": {},
    "outputs": [],
@@ -1187,7 +1187,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 41,
+   "execution_count": 37,
    "id": "712b1c74-cac6-4b3f-9421-8d8ffa9debc7",
    "metadata": {},
    "outputs": [
@@ -1195,7 +1195,7 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "Dummy result for histogram: [36, 33, 29, 0]\n"
+      "Dummy result for histogram: [39, 33, 29, 0]\n"
      ]
     }
    ],
@@ -1217,7 +1217,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 42,
+   "execution_count": 38,
    "id": "3f942b1b-94bc-468e-8374-3034f2e6b8ce",
    "metadata": {},
    "outputs": [
@@ -1227,7 +1227,7 @@
        "{'epsilon_cost': 2.0, 'delta_cost': 0}"
       ]
      },
-     "execution_count": 42,
+     "execution_count": 38,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1249,7 +1249,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 43,
+   "execution_count": 39,
    "id": "c6fe47b7-048e-404a-bedb-720e734b0c70",
    "metadata": {},
    "outputs": [],
@@ -1261,7 +1261,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 38,
+   "execution_count": 40,
    "id": "78d1aa05-2777-476b-9520-f9206399670d",
    "metadata": {},
    "outputs": [
@@ -1269,12 +1269,12 @@
      "data": {
       "text/plain": [
        "{'requested_by': 'Dr. Antartica',\n",
-       " 'query_response': [152, 68, 124, 0],\n",
+       " 'query_response': [153, 68, 123, 0],\n",
        " 'spent_epsilon': 2.0,\n",
        " 'spent_delta': 0}"
       ]
      },
-     "execution_count": 38,
+     "execution_count": 40,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1285,7 +1285,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 39,
+   "execution_count": 41,
    "id": "b8d5fd82-5ded-47ec-8135-f6870865055d",
    "metadata": {
     "scrolled": true
@@ -1295,9 +1295,9 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "Species Adelie has 152 penguins.\n",
+      "Species Adelie has 153 penguins.\n",
       "Species Chinstrap has 68 penguins.\n",
-      "Species Gentoo has 124 penguins.\n",
+      "Species Gentoo has 123 penguins.\n",
       "Species Unknown has 0 penguins.\n"
      ]
     }
@@ -1328,7 +1328,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 40,
+   "execution_count": 42,
    "id": "008fd230-cdfd-4e03-91ce-5a60b06c106d",
    "metadata": {},
    "outputs": [
@@ -1346,38 +1346,38 @@
        "  'response': {'requested_by': 'Dr. Antartica',\n",
        "   'query_response': {'index': [0],\n",
        "    'columns': ['nb_penguins', 'avg_bill_length_mm'],\n",
-       "    'data': [[342, 42.93065072561188]],\n",
+       "    'data': [[344, 43.78962738762428]],\n",
        "    'index_names': [None],\n",
        "    'column_names': [None]},\n",
        "   'spent_epsilon': 1.5,\n",
        "   'spent_delta': 0.00014999500000001387},\n",
-       "  'timestamp': 1717666971.0667355,\n",
+       "  'timestamp': 1718639441.4947808,\n",
        "  'dp_librairy': 'smartnoise_sql'},\n",
        " {'user_name': 'Dr. Antartica',\n",
        "  'dataset_name': 'PENGUIN',\n",
        "  'client_input': {'dataset_name': 'PENGUIN',\n",
-       "   'opendp_json': <opendp.mod.Measurement at 0x7a92cbffc5f0>,\n",
+       "   'opendp_json': <opendp.mod.Measurement at 0x7f55e33e7ec0>,\n",
        "   'fixed_delta': None},\n",
        "  'response': {'requested_by': 'Dr. Antartica',\n",
-       "   'query_response': 27.68648927291686,\n",
-       "   'spent_epsilon': 0.7163742690067888,\n",
+       "   'query_response': 38.73111553579249,\n",
+       "   'spent_epsilon': 0.7122093023265229,\n",
        "   'spent_delta': 0},\n",
-       "  'timestamp': 1717666974.674265,\n",
+       "  'timestamp': 1718639449.4530268,\n",
        "  'dp_librairy': 'opendp'},\n",
        " {'user_name': 'Dr. Antartica',\n",
        "  'dataset_name': 'PENGUIN',\n",
        "  'client_input': {'dataset_name': 'PENGUIN',\n",
-       "   'opendp_json': <opendp.mod.Measurement at 0x7a92cbffc9e0>,\n",
+       "   'opendp_json': <opendp.mod.Measurement at 0x7f55e33e7f50>,\n",
        "   'fixed_delta': None},\n",
        "  'response': {'requested_by': 'Dr. Antartica',\n",
-       "   'query_response': [152, 68, 124, 0],\n",
+       "   'query_response': [153, 68, 123, 0],\n",
        "   'spent_epsilon': 2.0,\n",
        "   'spent_delta': 0},\n",
-       "  'timestamp': 1717666977.146055,\n",
+       "  'timestamp': 1718639455.3108685,\n",
        "  'dp_librairy': 'opendp'}]"
       ]
      },
-     "execution_count": 40,
+     "execution_count": 42,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1386,6 +1386,14 @@
     "previous_queries = client.get_previous_queries()\n",
     "previous_queries"
    ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "b712b269-64f2-4c7e-b8bf-d1a608933eff",
+   "metadata": {},
+   "outputs": [],
+   "source": []
   }
  ],
  "metadata": {
diff --git a/client/requirements.txt b/client/requirements.txt
index c96b9987..6e4110c8 100644
--- a/client/requirements.txt
+++ b/client/requirements.txt
@@ -1,10 +1,8 @@
-#diffprivlib == 0.6.0
-numpy
-opendp == 0.8.0
+#diffprivlib==0.6.0
+jupyter==1.0.0
+numpy==1.26.4
+opendp==0.8.0
 opendp_logger==0.3.0
-pandas
-requests
-#scikit-learn >= 1.1.2
-matplotlib
-seaborn
-jupyter
\ No newline at end of file
+pandas==2.2.2
+requests==2.31.0
+#scikit-learn>=1.1.2
\ No newline at end of file
diff --git a/server/admin_requirements.txt b/server/admin_requirements.txt
deleted file mode 100644
index 31611654..00000000
--- a/server/admin_requirements.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-annotated-types==0.5.0
-anyio==3.7.1
-asttokens==2.4.0
-backcall==0.2.0
-boto3==1.34.115
-comm==0.1.4
-debugpy==1.7.0
-decorator==5.1.1
-dnspython==2.4.2
-executing==1.2.0
-fastapi==0.103.1
-httpx==0.27.0
-idna==3.4
-ipykernel==6.25.2
-ipython==8.15.0
-jedi==0.19.0
-jupyter_client==8.3.1
-jupyter_core==5.3.1
-matplotlib-inline==0.1.6
-nest-asyncio==1.5.7
-numpy==1.26.4
-opendp==0.8.0
-opendp-logger==0.3.0
-packaging==23.1
-pandas==2.2.2
-parso==0.8.3
-pexpect==4.8.0
-pickleshare==0.7.5
-platformdirs==3.10.0
-prompt-toolkit==3.0.39
-psutil==5.9.5
-ptyprocess==0.7.0
-pure-eval==0.2.2
-pyaml==23.9.5
-pydantic==2.3.0
-pydantic_core==2.6.3
-Pygments==2.16.1
-pymongo==4.5.0
-python-dateutil==2.8.2
-PyYAML==6.0.1
-pyzmq==25.1.1
-six==1.16.0
-smartnoise-sql==1.0.3
-sniffio==1.3.0
-stack-data==0.6.2
-starlette==0.27.0
-tornado==6.3.3
-traitlets==5.9.0
-typing_extensions==4.7.1
-urllib3==1.26.15
-uvicorn==0.29.0
-wcwidth==0.2.6
diff --git a/server/requirements.txt b/server/requirements.txt
index 92ba1cf1..97675d15 100644
--- a/server/requirements.txt
+++ b/server/requirements.txt
@@ -1,16 +1,11 @@
-boto3
-coverage==7.5.3
-# diffprivlib==0.5.2
-fastapi
-httpx
-numpy
+boto3==1.34.115
+fastapi==0.103.1
+httpx==0.27.0
+numpy==1.26.4
 opendp==0.8.0
 opendp-logger==0.3.0
-pandas
-pydantic
-pymongo
-#python-multipart
-requests
-setuptools
+pandas==2.2.2
+pyaml==23.9.5
+pymongo==4.5.0
 smartnoise-sql==1.0.3
-uvicorn
\ No newline at end of file
+uvicorn==0.29.0


Test patch:
diff --git a/.github/workflows/test_and_coverage_server.yml b/.github/workflows/test_and_coverage_server.yml
index 2ec94635..0394505e 100644
--- a/.github/workflows/test_and_coverage_server.yml
+++ b/.github/workflows/test_and_coverage_server.yml
@@ -28,6 +28,7 @@ jobs:
       run: |
         cd server
         pip install -r requirements.txt
+        pip install coverage==7.5.3
     - name: Run test script
       run: |
         cd server