Re-implement machine-specs to contain documentation, units, etc. Print using tabulate

Signed-off-by: Nicholas Curtis <nicurtis@amd.com>


[ROCm/rocprofiler-compute commit: 200961ffd9]
This commit is contained in:
Nicholas Curtis
2024-02-29 10:21:29 -05:00
committed by Cole Ramos
parent 9ed1dd8f82
commit dcb928b7c7
5 changed files with 319 additions and 188 deletions
+11 -12
View File
@@ -50,6 +50,13 @@ def string_multiple_lines(source, width, max_rows):
return "\n".join(lines)
def get_table_string(df, transpose=False, decimal=2):
return tabulate(df.transpose() if transpose else df,
headers="keys",
tablefmt="fancy_grid",
floatfmt="." + str(decimal) + "f")
def show_all(args, runs, archConfigs, output):
"""
Show all panels with their data in plain text mode.
@@ -214,19 +221,11 @@ def show_all(args, runs, archConfigs, output):
# df when load it, because we need those items in column.
# For metric_table, we only need to show the data in column
# fash for now.
transpose = (type != "raw_csv_table"
and "columnwise" in table_config
and table_config["columnwise"] == True)
ss += (
tabulate(
(
df.transpose()
if type != "raw_csv_table"
and "columnwise" in table_config
and table_config["columnwise"] == True
else df
),
headers="keys",
tablefmt="fancy_grid",
floatfmt="." + str(args.decimal) + "f",
)
get_table_string(df, transpose=transpose, decimal=args.decimal)
+ "\n"
)