Skip to content

Commit 1421aea

Browse files
committed
remove redundant methods
1 parent d3c5052 commit 1421aea

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

benchmarks/run_benchmarks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def main() -> int:
223223
combined.metadata["elapsed_seconds"] = elapsed
224224

225225
if args.output:
226-
combined.save_json(args.output)
226+
Path(args.output).write_text(combined.model_dump_json(indent=2))
227227
print(f"\nResults saved to {args.output}")
228228

229229
# Compare against baseline if provided

benchmarks/utils.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from __future__ import annotations
77

8-
import json
98
import statistics
109
import time
1110
from typing import TYPE_CHECKING, Any
@@ -99,15 +98,3 @@ class BenchmarkSuite(BaseModel):
9998
def add_result(self, result: BenchmarkResult) -> None:
10099
"""Add a benchmark result to the suite."""
101100
self.results.append(result)
102-
103-
def save_json(self, path: str) -> None:
104-
"""Save results to JSON file."""
105-
with open(path, "w") as f:
106-
f.write(self.model_dump_json(indent=2))
107-
108-
@classmethod
109-
def load_json(cls, path: str) -> BenchmarkSuite:
110-
"""Load results from JSON file."""
111-
with open(path) as f:
112-
data = json.load(f)
113-
return cls.model_validate(data)

0 commit comments

Comments
 (0)