-
Notifications
You must be signed in to change notification settings - Fork 5
/
time_test.py
38 lines (33 loc) · 1.25 KB
/
time_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import argparse
from pathlib import Path
import util.config.config_util as cu
import util.file.file_util as fu
import util.linkage_agent.time_test_runner as ttr
def run_test(root_dir_abs_path):
config = cu.get_config_from_abs_path(root_dir_abs_path + "/config.json")
print("---------------------------")
print("Config:\n" + cu.get_json_pretty_printed(config))
print("---------------------------")
root_dir_name = root_dir_abs_path
patient_root_dir = str(Path(root_dir_abs_path, "patients"))
print("root_dir: " + root_dir_abs_path)
print("patient_dir: " + patient_root_dir)
patient_dirs = fu.get_dirs(patient_root_dir)
print("Got " + str(len(patient_dirs)) + " patient dirs")
ttr.run_time_test(root_dir_name, patient_dirs, config)
if __name__ == "__main__":
# get the args from the cmd line
print("Reading arguments...")
parser = argparse.ArgumentParser(
description="Tool for running time tests for"
"generating LINK_IDs in the CODI PPRL process"
)
parser.add_argument(
"--dir",
help="Fully specified path to where the test files are",
)
args = parser.parse_args()
print("Path: " + args.dir)
# get the derived params
root_dir = args.dir
run_test(root_dir)