MCPcopy Create free account
hub / github.com/Ropedia/SpatialBench / write_overall

Function write_overall

benchmark/evaluation/report.py:226–251  ·  view source on GitHub ↗

Append the condensed overall report to output_dir/overall.json. overall.json is a list; each evaluation appends one record, making it easy to compare multiple models side by side.

(report, output_dir)

Source from the content-addressed store, hash-verified

224
225
226def write_overall(report, output_dir):
227 """Append the condensed overall report to output_dir/overall.json.
228
229 overall.json is a list; each evaluation appends one record, making it easy
230 to compare multiple models side by side.
231 """
232 overall = build_overall(report)
233 overall_path = os.path.join(output_dir, "overall.json")
234
235 # Read existing records
236 existing = []
237 if os.path.isfile(overall_path):
238 try:
239 with open(overall_path, 'r') as f:
240 existing = json.load(f)
241 if not isinstance(existing, list):
242 existing = [existing]
243 except (json.JSONDecodeError, Exception):
244 existing = []
245
246 existing.append(overall)
247
248 os.makedirs(output_dir, exist_ok=True)
249 with open(overall_path, 'w') as f:
250 json.dump(existing, f, indent=2, default=str)
251 print(f"Overall summary appended to {overall_path}")
252
253
254def print_summary(report):

Callers 2

mainFunction · 0.90
mainFunction · 0.90

Calls 2

build_overallFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected