MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / serialize_records

Function serialize_records

PythonAPI/util/performance_benchmark.py:371–395  ·  view source on GitHub ↗
(records, system_specs, filename)

Source from the content-addressed store, hash-verified

369
370
371def serialize_records(records, system_specs, filename):
372 with open(filename, 'w+') as fd:
373 s = "| Town | Sensors | Weather | # of Vehicles | # of Walkers | Samples | Mean FPS | Std FPS |\n"
374 s += "| ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- |\n"
375 fd.write(s)
376
377 for sensor_key in sorted(records.keys()):
378 list_records = records[sensor_key]
379 for record in list_records:
380 s = "| {} | {} | {} | {} | {} | {} | {:03.2f} | {:03.2f} |\n".format(record['town'],
381 record['sensors'],
382 record['weather'],
383 record['n_vehicles'],
384 record['n_walkers'],
385 record['samples'],
386 record['fps_mean'],
387 record['fps_std'])
388 fd.write(s)
389
390 s = "\n| Global mean FPS | Global std FPS |\n"
391 s += "| **{:03.2f}** | **{:03.2f}** |\n".format(*get_total(records))
392 fd.write(s)
393
394 s = "Table: {}.\n".format(system_specs)
395 fd.write(s)
396
397
398def get_total(records):

Callers 1

mainFunction · 0.85

Calls 2

get_totalFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected