xnn.common.benchmark.report.format_table#

xnn.common.benchmark.report.format_table(rows, units=None)[source]#

Render results as an aligned monospaced table for printing.

Parameters:
  • rows (list of dict) – Result rows.

  • units (dict of str to str or None, optional) – Physical unit for any column, keyed by column name. When a column has a unit its header cell is suffixed with [unit] (e.g. energy_mae [eV/atom]). Columns absent from the mapping keep a plain header.

Returns:

A multi-line string with a header, an underline rule and one line per row. Returns "(no results)" when there are no rows.

Return type:

str