diff --git a/python/raft-ann-bench/src/raft-ann-bench/get_dataset/__main__.py b/python/raft-ann-bench/src/raft-ann-bench/get_dataset/__main__.py index d2cb8ebe98..4e6a0119b4 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/get_dataset/__main__.py +++ b/python/raft-ann-bench/src/raft-ann-bench/get_dataset/__main__.py @@ -36,12 +36,13 @@ def convert_hdf5_to_fbin(path, normalize): ann_bench_scripts_path = os.path.join(scripts_path, "hdf5_to_fbin.py") print(f"calling script {ann_bench_scripts_path}") if normalize and "angular" in path: - p = subprocess.Popen( - ["python", ann_bench_scripts_path, "-n", "%s" % path] + subprocess.run( + ["python", ann_bench_scripts_path, "-n", "%s" % path], check=True ) else: - p = subprocess.Popen(["python", ann_bench_scripts_path, "%s" % path]) - p.wait() + subprocess.run( + ["python", ann_bench_scripts_path, "%s" % path], check=True + ) def move(name, ann_bench_data_path): diff --git a/python/raft-ann-bench/src/raft-ann-bench/run/__main__.py b/python/raft-ann-bench/src/raft-ann-bench/run/__main__.py index 347c68c477..9e2da7328d 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/run/__main__.py +++ b/python/raft-ann-bench/src/raft-ann-bench/run/__main__.py @@ -110,9 +110,7 @@ def run_build_and_search( if force: cmd = cmd + ["--overwrite"] cmd = cmd + [temp_conf_filepath] - print(cmd) - p = subprocess.Popen(cmd) - p.wait() + subprocess.run(cmd, check=True) if search: search_folder = os.path.join(legacy_result_folder, "search") @@ -132,9 +130,7 @@ def run_build_and_search( if force: cmd = cmd + ["--overwrite"] cmd = cmd + [temp_conf_filepath] - print(cmd) - p = subprocess.Popen(cmd) - p.wait() + subprocess.run(cmd, check=True) os.remove(temp_conf_filepath) diff --git a/python/raft-ann-bench/src/raft-ann-bench/split_groundtruth/__main__.py b/python/raft-ann-bench/src/raft-ann-bench/split_groundtruth/__main__.py index 161617f85c..e8625ce7d7 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/split_groundtruth/__main__.py +++ b/python/raft-ann-bench/src/raft-ann-bench/split_groundtruth/__main__.py @@ -23,10 +23,10 @@ def split_groundtruth(groundtruth_filepath): pwd = os.getcwd() os.chdir("/".join(groundtruth_filepath.split("/")[:-1])) groundtruth_filename = groundtruth_filepath.split("/")[-1] - p = subprocess.Popen( - [ann_bench_scripts_path, groundtruth_filename, "groundtruth"] + subprocess.run( + [ann_bench_scripts_path, groundtruth_filename, "groundtruth"], + check=True, ) - p.wait() os.chdir(pwd)