From 46bd3ddc6e8c962f2f5fba613c6295f0d6f9f651 Mon Sep 17 00:00:00 2001 From: "fei.zheng" Date: Thu, 4 May 2023 11:46:34 -0600 Subject: [PATCH] format code Signed-off-by: fei.zheng [ROCm/rocprofiler-compute commit: 2e0a603930a1e9f44e5b5b9f5911d2df51360b6f] --- .../src/omniperf_analyze/utils/parser.py | 1 + .../src/omniperf_analyze/utils/tty.py | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/projects/rocprofiler-compute/src/omniperf_analyze/utils/parser.py b/projects/rocprofiler-compute/src/omniperf_analyze/utils/parser.py index 5449804c25..fa3dec1591 100644 --- a/projects/rocprofiler-compute/src/omniperf_analyze/utils/parser.py +++ b/projects/rocprofiler-compute/src/omniperf_analyze/utils/parser.py @@ -718,6 +718,7 @@ def load_table_data(workload, dir, is_gui, debug, verbose): debug, ) + def build_comparable_columns(time_unit): """ Build comparable columns/headers for display diff --git a/projects/rocprofiler-compute/src/omniperf_analyze/utils/tty.py b/projects/rocprofiler-compute/src/omniperf_analyze/utils/tty.py index cc38e68c0a..b8d32c274e 100644 --- a/projects/rocprofiler-compute/src/omniperf_analyze/utils/tty.py +++ b/projects/rocprofiler-compute/src/omniperf_analyze/utils/tty.py @@ -48,8 +48,9 @@ def string_multiple_lines(source, width, max_rows): return "\n".join(lines) -def show_all(runs, archConfigs, output, df_file_dir, decimal, time_unit, - selected_cols, verbose): +def show_all( + runs, archConfigs, output, df_file_dir, decimal, time_unit, selected_cols, verbose +): """ Show all panels with their data in plain text mode. """ @@ -154,24 +155,26 @@ def show_all(runs, archConfigs, output, df_file_dir, decimal, time_unit, if not df.empty: # subtitle for each table in a panel if existing - table_id_str = str(table_config["id"] // 100) + "." + str( - table_config["id"] % 100) + table_id_str = ( + str(table_config["id"] // 100) + + "." + + str(table_config["id"] % 100) + ) if "title" in table_config and table_config["title"]: - ss += (table_id_str + " " + table_config["title"] + - "\n") + ss += table_id_str + " " + table_config["title"] + "\n" if df_file_dir: p = Path(df_file_dir) if not p.exists(): p.mkdir() if p.is_dir(): - if "title" in table_config and table_config[ - "title"]: - table_id_str += ("_" + table_config["title"]) - df.to_csv(p.joinpath( - table_id_str.replace(" ", "_") + ".csv"), - index=False) + if "title" in table_config and table_config["title"]: + table_id_str += "_" + table_config["title"] + df.to_csv( + p.joinpath(table_id_str.replace(" ", "_") + ".csv"), + index=False, + ) # NB: # "columnwise: True" is a special attr of a table/df