Skip to content

Commit

Permalink
Update graphs.ipynb
Browse files Browse the repository at this point in the history
Do not crash if some executions are missing, just do not display them
  • Loading branch information
marcocosta97 committed Sep 6, 2024
1 parent 7f7552d commit ca3011a
Showing 1 changed file with 46 additions and 30 deletions.
76 changes: 46 additions & 30 deletions bench/scripts/graphs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 20,
"metadata": {
"ExecuteTime": {
"end_time": "2023-05-15T08:31:57.764488Z",
Expand Down Expand Up @@ -38,7 +38,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"metadata": {
"ExecuteTime": {
"end_time": "2023-05-15T08:32:51.430480Z",
Expand Down Expand Up @@ -134,7 +134,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"metadata": {
"collapsed": false
},
Expand All @@ -150,7 +150,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -166,7 +166,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -181,10 +181,12 @@
" for (x, ds, r) in iterate:\n",
" row = workloads.index(x)\n",
" (idx, ran) = r\n",
" if type(x) is tuple:\n",
" data = pd.read_csv(get_file(ds, r[1], x[0], x[1], path=fpr_test_path))\n",
" else:\n",
" data = pd.read_csv(get_file(ds, r[1], x, path=fpr_real_test_path))\n",
" try:\n",
" if type(x) is tuple:\n",
" data = pd.read_csv(get_file(ds, r[1], x[0], x[1], path=fpr_test_path))\n",
" else:\n",
" data = pd.read_csv(get_file(ds, r[1], x, path=fpr_real_test_path))\n",
" except: continue\n",
" data['fpr_opt'] = data['false_positives'] / data['n_queries']\n",
" data.plot(\"bpk\", \"fpr_opt\", ax=axes[row][idx], **range_filters_style_kwargs[ds], **lines_style)\n",
"\n",
Expand Down Expand Up @@ -232,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -245,12 +247,14 @@
"\n",
" for (x, ds, r) in iterate:\n",
" row = workloads.index(x)\n",
" if type(x) is tuple:\n",
" data = pd.read_csv(get_file(ds, r[1], x[0], x[1], path=fpr_test_path))\n",
" else:\n",
" data = pd.read_csv(get_file(ds, r[1], x, path=fpr_real_test_path))\n",
" try:\n",
" if type(x) is tuple:\n",
" data = pd.read_csv(get_file(ds, r[1], x[0], x[1], path=fpr_test_path))\n",
" else:\n",
" data = pd.read_csv(get_file(ds, r[1], x, path=fpr_real_test_path))\n",
" except: continue\n",
" data[\"single_query_time\"] = (data[\"query_time\"] / data[\"n_queries\"]) * 10**6\n",
" workload_row[row][ds].append(round(data[\"single_query_time\"].mean(), 2))\n",
" workload_row[row][range_filters_style_kwargs[ds]['label']].append(round(data[\"single_query_time\"].mean(), 2))\n",
"\n",
" mean_row = [collections.defaultdict(list) for _ in range(nrows)]\n",
" for i in range(nrows):\n",
Expand Down Expand Up @@ -301,7 +305,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -331,7 +335,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -368,7 +372,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -405,7 +409,9 @@
"iterate = list(itertools.product(keys_size, range_filters))\n",
"for (r, ds) in iterate:\n",
" i = r - min(keys_size)\n",
" data = pd.read_csv(get_file(ds, 5, f'kuniform_{r}', query_name='quniform', path=size_test_path))\n",
" try:\n",
" data = pd.read_csv(get_file(ds, 5, f'kuniform_{r}', query_name='quniform', path=size_test_path))\n",
" except: continue\n",
" if data.empty or data[\"build_time\"].empty: continue\n",
"\n",
" if \"modelling_time\" in data.columns:\n",
Expand Down Expand Up @@ -442,7 +448,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -473,7 +479,9 @@
"\n",
"for (ds, r) in iterate:\n",
" (idx, ran) = r\n",
" data = pd.read_csv(get_file(ds, r[1], 'kuniform', 'qtrue', true_test_path))\n",
" try:\n",
" data = pd.read_csv(get_file(ds, r[1], 'kuniform', 'qtrue', true_test_path))\n",
" except: continue\n",
" data[\"single_query_time\"] = (data[\"query_time\"] / data[\"n_queries\"]) * 10**6\n",
" data.plot(\"bpk\", \"single_query_time\", ax=axes[idx], **range_filters_style_kwargs[ds], **lines_style)\n",
"\n",
Expand Down Expand Up @@ -517,7 +525,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -558,10 +566,14 @@
"\n",
"for (ds, r, deg) in iterate:\n",
" (idx, ran) = r\n",
" data = pd.read_csv(get_file(ds, r[1], f'kuniform_{deg}', 'qcorrelated', corr_test_path))\n",
" data['fpr_opt'] = data['false_positives'] / data['n_queries']\n",
" fpr = data['fpr_opt'][0]\n",
" time = data['query_time'][0]/data['n_queries'][0] * 10**6\n",
" try:\n",
" data = pd.read_csv(get_file(ds, r[1], f'kuniform_{deg}', 'qcorrelated', corr_test_path))\n",
" data['fpr_opt'] = data['false_positives'] / data['n_queries'] \n",
" time = data['query_time'][0]/data['n_queries'][0] * 10**6\n",
" fpr = data['fpr_opt'][0]\n",
" except:\n",
" fpr = None\n",
" time = None\n",
" values[idx][ds].append(fpr)\n",
" time_values[idx][ds].append(time)\n",
" \n",
Expand Down Expand Up @@ -640,10 +652,14 @@
"\n",
"for (ds, r, deg) in iterate:\n",
" (idx, ran) = r\n",
" data = pd.read_csv(get_file(ds, r[1], f'kuniform_{deg}', 'qcorrelated', corr_test_path))\n",
" data['fpr_opt'] = data['false_positives'] / data['n_queries']\n",
" fpr = data['fpr'][0]\n",
" time = data['query_time'][0]/data['n_queries'][0] * 10**6\n",
" try:\n",
" data = pd.read_csv(get_file(ds, r[1], f'kuniform_{deg}', 'qcorrelated', corr_test_path))\n",
" data['fpr_opt'] = data['false_positives'] / data['n_queries']\n",
" fpr = data['fpr'][0]\n",
" time = data['query_time'][0]/data['n_queries'][0] * 10**6\n",
" except:\n",
" fpr = None\n",
" time = None\n",
" values[idx][ds].append(fpr)\n",
" time_values[idx][ds].append(time)\n",
" \n",
Expand Down

0 comments on commit ca3011a

Please sign in to comment.