mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
ruff format
This commit is contained in:
@@ -12,20 +12,20 @@ class ReleaseGenerator:
|
||||
def __init__(self, lib_version: str) -> None:
|
||||
self.lib_version = lib_version
|
||||
self.output_dir = Path("metrics/reports/releases") / lib_version
|
||||
|
||||
|
||||
def generate_release(self, benchmark_groups: list[BenchmarkGroupResult]) -> Path:
|
||||
if self.output_dir.exists():
|
||||
shutil.rmtree(self.output_dir)
|
||||
|
||||
|
||||
self.output_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
for benchmark_group in benchmark_groups:
|
||||
type_dir = self.output_dir / benchmark_group.type_
|
||||
type_dir.mkdir(exist_ok=True)
|
||||
|
||||
|
||||
diagram_generator = DiagramGenerator(type_dir)
|
||||
diagram_generator.generate_comparison_diagram(benchmark_group)
|
||||
|
||||
|
||||
json_data = {
|
||||
"type": benchmark_group.type_,
|
||||
"iterations": benchmark_group.iterations,
|
||||
@@ -36,14 +36,14 @@ class ReleaseGenerator:
|
||||
"description": br.description,
|
||||
"avg_time": br.avg_time,
|
||||
"median_time": br.median_time,
|
||||
"std_dev": br.std_dev
|
||||
"std_dev": br.std_dev,
|
||||
}
|
||||
for br in benchmark_group.benchmark_results
|
||||
]
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
json_path = type_dir / f"{benchmark_group.type_}.json"
|
||||
with open(json_path, 'w', encoding='utf-8') as f:
|
||||
with open(json_path, "w", encoding="utf-8") as f:
|
||||
json.dump(json_data, f, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
return self.output_dir
|
||||
|
||||
Reference in New Issue
Block a user