From 0009b1e3a62e1907eb98a19ebd3c6432f47ae5cb Mon Sep 17 00:00:00 2001 From: Anton Lokhmotov Date: Thu, 25 Jan 2024 23:59:16 +0000 Subject: [PATCH 1/3] Ignore trailing whitespace lines in spl.txt files. --- tools/submission/power/power_checker.py | 1 + tools/submission/submission_checker.py | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/submission/power/power_checker.py b/tools/submission/power/power_checker.py index 5adcd197c..ac9cb0a17 100755 --- a/tools/submission/power/power_checker.py +++ b/tools/submission/power/power_checker.py @@ -408,6 +408,7 @@ def get_avg_power(power_path: str, run_path: str) -> Tuple[float, float]: with open(spl_fname) as f: for line in f: + if not line.startswith("Time"): continue timestamp = ( datetime.strptime(line.split(",")[1], datetime_format) ).replace(tzinfo=timezone.utc) diff --git a/tools/submission/submission_checker.py b/tools/submission/submission_checker.py index bd716fbd0..6214ebb1b 100755 --- a/tools/submission/submission_checker.py +++ b/tools/submission/submission_checker.py @@ -2259,6 +2259,7 @@ def get_power_metric(config, scenario_fixed, log_path, is_valid, res): power_list = [] with open(spl_fname) as f: for line in f: + if not line.startswith("Time"): continue timestamp = ( datetime.datetime.strptime(line.split(",")[1], datetime_format) + server_timezone From 6a35850950db5165306746d699d76167bd8ee310 Mon Sep 17 00:00:00 2001 From: Anton Lokhmotov Date: Fri, 26 Jan 2024 11:06:15 +0000 Subject: [PATCH 2/3] Remove fix from sync'ed power_checker.py. --- tools/submission/power/power_checker.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/submission/power/power_checker.py b/tools/submission/power/power_checker.py index ac9cb0a17..5adcd197c 100755 --- a/tools/submission/power/power_checker.py +++ b/tools/submission/power/power_checker.py @@ -408,7 +408,6 @@ def get_avg_power(power_path: str, run_path: str) -> Tuple[float, float]: with open(spl_fname) as f: for line in f: - if not line.startswith("Time"): continue timestamp = ( datetime.strptime(line.split(",")[1], datetime_format) ).replace(tzinfo=timezone.utc) From 7f852306435c8d018fbe01a62393febf5f80c05b Mon Sep 17 00:00:00 2001 From: Anton Lokhmotov Date: Fri, 26 Jan 2024 11:40:35 +0000 Subject: [PATCH 3/3] Reformat according to black. --- tools/submission/submission_checker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/submission/submission_checker.py b/tools/submission/submission_checker.py index e8b9ca76d..ac76c5dea 100755 --- a/tools/submission/submission_checker.py +++ b/tools/submission/submission_checker.py @@ -2261,7 +2261,8 @@ def get_power_metric(config, scenario_fixed, log_path, is_valid, res): power_list = [] with open(spl_fname) as f: for line in f: - if not line.startswith("Time"): continue + if not line.startswith("Time"): + continue timestamp = ( datetime.datetime.strptime(line.split(",")[1], datetime_format) + server_timezone