diff --git a/Makefile b/Makefile index 0226e3b..cd49471 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ all: SOURCES = hwbench csv graph -RUFF_VERSION = 0.8.6 +RUFF_VERSION = 0.9.0 update_deps: uv sync -U diff --git a/csv/convert.py b/csv/convert.py index 52f585a..a39865b 100755 --- a/csv/convert.py +++ b/csv/convert.py @@ -128,8 +128,8 @@ def memrate_key(r): r.get("job_name", "") + r.get("engine_module", "") + r.get("key", "") - + f'{r.get("workers", ""):05}' - + f'{r.get("job_number", ""):06}' + + f"{r.get('workers', ''):05}" + + f"{r.get('job_number', ''):06}" ) results_sorted = sorted(result_list, key=memrate_key) @@ -147,8 +147,8 @@ def result_key(r): + r.get("engine_module", "") + r.get("engine_module_parameter", "") + r.get("job_name", "") - + f'{r.get("workers", ""):05}' - + f'{r.get("job_number", "")}' + + f"{r.get('workers', ''):05}" + + f"{r.get('job_number', '')}" ) diff --git a/graph/graph.py b/graph/graph.py index 914fce4..657cc42 100644 --- a/graph/graph.py +++ b/graph/graph.py @@ -263,7 +263,7 @@ def generic_graph( # If the user didn't explictely agreed to be replaced by 0, let's be fatal if not args.ignore_missing_datapoint: fatal( - f"{trace.get_name()}/{bench.get_bench_name()}: {component.get_full_name()} is missing the {sample+1}th data point.\ + f"{trace.get_name()}/{bench.get_bench_name()}: {component.get_full_name()} is missing the {sample + 1}th data point.\ Use --ignore-missing-datapoint to ignore this case. Generated graphs will be partially incorrect." ) else: @@ -292,7 +292,7 @@ def generic_graph( # If the user didn't explictely agreed to be replaced by 0, let's be fatal if not args.ignore_missing_datapoint: fatal( - f"{trace.get_name()}/{bench.get_bench_name()}: second axis of {sensor}: {measure.get_full_name()} is missing the {sample+1}th data point.\ + f"{trace.get_name()}/{bench.get_bench_name()}: second axis of {sensor}: {measure.get_full_name()} is missing the {sample + 1}th data point.\ Use --ignore-missing-datapoint to ignore this case. Generated graphs will be partially incorrect." ) else: diff --git a/graph/individual.py b/graph/individual.py index 4fc06a8..7fcd9d9 100644 --- a/graph/individual.py +++ b/graph/individual.py @@ -86,7 +86,7 @@ def individual_graph(args, output_dir, job: str, traces_name: list) -> int: clean_perf = perf.replace(" ", "").replace("/", "") y_label = unit outdir = temp_outdir.joinpath(graph_type) - outfile = f"{bench.get_title_engine_name().replace(' ','_')}" + outfile = f"{bench.get_title_engine_name().replace(' ', '_')}" # Let's define the tree architecture based on the benchmark profile # If the benchmark has multiple performance results, let's put them in a specific directory diff --git a/graph/scaling.py b/graph/scaling.py index 4d9e210..f7db125 100644 --- a/graph/scaling.py +++ b/graph/scaling.py @@ -95,21 +95,21 @@ def scaling_graph(args, output_dir, job: str, traces_name: list) -> int: f"Scaling {graph_type}: '{bench.get_title_engine_name()} / {args.traces[0].get_metric_name()}'" ) y_label = f"{unit} per Watt" - outfile = f"scaling_watt_{clean_perf}_{bench.get_title_engine_name().replace(' ','_')}" + outfile = f"scaling_watt_{clean_perf}_{bench.get_title_engine_name().replace(' ', '_')}" y_source = aggregated_perfs_watt elif "watts" in graph_type: graph_type_title = f"Scaling {graph_type}: {args.traces[0].get_metric_name()}" - outfile = f"scaling_watt_{clean_perf}_{bench.get_title_engine_name().replace(' ','_')}" + outfile = f"scaling_watt_{clean_perf}_{bench.get_title_engine_name().replace(' ', '_')}" y_label = "Watts" y_source = aggregated_watt elif "cpu_clock" in graph_type: graph_type_title = f"Scaling {graph_type}: {args.traces[0].get_metric_name()}" - outfile = f"scaling_cpu_clock_{clean_perf}_{bench.get_title_engine_name().replace(' ','_')}" + outfile = f"scaling_cpu_clock_{clean_perf}_{bench.get_title_engine_name().replace(' ', '_')}" y_label = "Mhz" y_source = aggregated_cpu_clock else: graph_type_title = f"Scaling {graph_type}: {bench.get_title_engine_name()}" - outfile = f"scaling_{clean_perf}_{bench.get_title_engine_name().replace(' ','_')}" + outfile = f"scaling_{clean_perf}_{bench.get_title_engine_name().replace(' ', '_')}" y_source = aggregated_perfs title = f'{args.title}\n\n{graph_type_title} via "{job}" benchmark job\n\n Stressor: ' diff --git a/graph/trace.py b/graph/trace.py index 5dd3b37..e2418f8 100644 --- a/graph/trace.py +++ b/graph/trace.py @@ -241,7 +241,7 @@ def add_perf( if delta > 1: print( f"{self.trace.get_name()}/{self.get_bench_name()} didn't completed on time. " - f"Effective_runtime={effective_runtime} vs {self.duration()} : delta=[{delta:.2f}s; {delta/self.duration()*100:.2f}%]" + f"Effective_runtime={effective_runtime} vs {self.duration()} : delta=[{delta:.2f}s; {delta / self.duration() * 100:.2f}%]" ) except TypeError: # We can ignore the delay computation if effective_runtime is not defined diff --git a/hwbench/config/config.py b/hwbench/config/config.py index 3f1596c..4c1c85b 100644 --- a/hwbench/config/config.py +++ b/hwbench/config/config.py @@ -153,7 +153,7 @@ def get_physical_cores(core): # Let's replace 'all' special keyword if any all = re.findall("all", hcc) if all: - hcc = hcc.replace("all", f"0-{self.hardware.get_cpu().get_logical_cores_count()-1}") + hcc = hcc.replace("all", f"0-{self.hardware.get_cpu().get_logical_cores_count() - 1}") # Let's replace helpers if any helpers = re.findall("simple", hcc) diff --git a/hwbench/environment/turbostat.py b/hwbench/environment/turbostat.py index 7612fda..5d5881f 100644 --- a/hwbench/environment/turbostat.py +++ b/hwbench/environment/turbostat.py @@ -150,7 +150,7 @@ def run(self, interval: float = 1, wait=False): cmd_line = [ "taskset", "-c", - f"{self.hardware.get_cpu().get_logical_cores_count()-1}", + f"{self.hardware.get_cpu().get_logical_cores_count() - 1}", "turbostat", "--cpu", "core", diff --git a/hwbench/environment/vendors/hpe/hpe.py b/hwbench/environment/vendors/hpe/hpe.py index c02396d..5887683 100644 --- a/hwbench/environment/vendors/hpe/hpe.py +++ b/hwbench/environment/vendors/hpe/hpe.py @@ -119,7 +119,7 @@ def read_power_supplies( # Let's inform the user the PSU is reported as non healthy self.__warn_psu( psu_position, - f'marked as {psu_state} in {psu_status.get("Health")} state', + f"marked as {psu_state} in {psu_status.get('Health')} state", ) continue diff --git a/hwbench/utils/helpers.py b/hwbench/utils/helpers.py index 501545c..e022619 100644 --- a/hwbench/utils/helpers.py +++ b/hwbench/utils/helpers.py @@ -53,7 +53,7 @@ def cpu_list_to_range(cpu_list: list[int]) -> str: if not is_immediately_next: if needs_compression: - output.append(f"{previous_entry}-{cpu_list[i-1]}") + output.append(f"{previous_entry}-{cpu_list[i - 1]}") else: output.append(str(previous_entry)) previous_entry = current_entry