From e41073bc2ca83b768a58f251e3802841ba573a93 Mon Sep 17 00:00:00 2001 From: jeremy Date: Fri, 4 Nov 2022 09:17:09 +0100 Subject: [PATCH] Update script to need single argument for local dataset --- tests/mgbench/benchmark.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/mgbench/benchmark.py b/tests/mgbench/benchmark.py index 6458447d0..f6b0a19ca 100755 --- a/tests/mgbench/benchmark.py +++ b/tests/mgbench/benchmark.py @@ -27,6 +27,7 @@ import helpers import runners import importlib import time +import os def get_queries(gen, count): @@ -119,13 +120,15 @@ parser.add_argument( "--temporary-directory", default="/tmp", help="directory path where temporary data should " "be stored" ) parser.add_argument("--no-properties-on-edges", action="store_true", help="disable properties on edges") -parser.add_argument("--datasets", default="datasets", help="datasets to scan") parser.add_argument("--datasets-path", default=".", help="path to datasets to scan") parser.add_argument("--test-system-args", default="") args = parser.parse_args() -sys.path.append(args.datasets_path) -dataset_to_use = importlib.import_module(args.datasets) +head_tail = os.path.split(args.datasets_path) +path_without_dataset_name = head_tail[0] +dataset_name = head_tail[1] +sys.path.append(path_without_dataset_name) +dataset_to_use = importlib.import_module(dataset_name) # Detect available datasets. generators = {}