Skip to content

Commit ee2bb12

Browse files
committed
ruff-fix
1 parent 7a67de3 commit ee2bb12

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/python/knnPerfTest.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import subprocess
2424
import sys
2525
import time
26+
from pathlib import Path
2627

2728
import autologger
2829
import benchUtil
@@ -457,8 +458,10 @@ def run_knn_benchmark(checkout, values, log_path):
457458
def write_vmstat_pretties(vmstat_log_file_name, full_cmd):
458459
print(f"write vmstat pretties from log={vmstat_log_file_name}")
459460

460-
dir_name, file_name = os.path.split(vmstat_log_file_name)
461-
base_name, ext = os.path.splitext(file_name)
461+
vmstat_log_path = Path(vmstat_log_file_name)
462+
dir_name = vmstat_log_path.parent
463+
base_name = vmstat_log_path.stem
464+
ext = vmstat_log_path.suffix
462465

463466
vmstat_dir_name = f"{dir_name}/{base_name}-vmstat-charts"
464467
print(f"see {vmstat_dir_name}/index.html for vmstat visualization")
@@ -817,8 +820,10 @@ def run_n_knn_benchmarks(LUCENE_CHECKOUT, PARAMS, n, log_path):
817820

818821
if __name__ == "__main__":
819822
with autologger.capture_output() as log_path:
820-
log_dir_name, log_file_name = os.path.split(log_path)
821-
log_base_name, log_ext = os.path.splitext(log_file_name)
823+
log_path = Path(log_path)
824+
log_dir_name = log_path.parent
825+
log_base_name = log_path.stem
826+
log_ext = log_path.suffix
822827

823828
# print cpu and memory information at the start
824829
print_cpu_info()

0 commit comments

Comments
 (0)