File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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"\n Results saved to { args .output } " )
228228
229229 # Compare against baseline if provided
Original file line number Diff line number Diff line change 55
66from __future__ import annotations
77
8- import json
98import statistics
109import time
1110from 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 )
You can’t perform that action at this time.
0 commit comments