MCPcopy
hub / github.com/algorithmicsuperintelligence/optillm / save_result

Function save_result

scripts/eval_imo25_benchmark.py:592–605  ·  view source on GitHub ↗

Save a single result to the results file.

(filename: str, result: Dict)

Source from the content-addressed store, hash-verified

590 }
591
592def save_result(filename: str, result: Dict):
593 """Save a single result to the results file."""
594 results = []
595 if os.path.exists(filename):
596 try:
597 with open(filename, 'r') as f:
598 results = json.load(f)
599 except (FileNotFoundError, json.JSONDecodeError):
600 results = []
601
602 results.append(result)
603
604 with open(filename, 'w') as f:
605 json.dump(results, f, indent=2)
606
607def load_existing_results(filename: str) -> List[Dict]:
608 """Load existing results from file if it exists."""

Callers 1

mainFunction · 0.70

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected