From 216fa7d5f60fa7554879d19aae6eb288f4aaf2a6 Mon Sep 17 00:00:00 2001 From: ywang103-amd Date: Thu, 20 Feb 2025 10:20:06 -0500 Subject: [PATCH] Parser: to_int() return None instead of np.nan (#569) [ROCm/rocprofiler-compute commit: e5803eb2433f87503f7c9d8345b6e7e4cd2689df] --- projects/rocprofiler-compute/src/utils/parser.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/rocprofiler-compute/src/utils/parser.py b/projects/rocprofiler-compute/src/utils/parser.py index 2e7c03d78e..459d340a45 100644 --- a/projects/rocprofiler-compute/src/utils/parser.py +++ b/projects/rocprofiler-compute/src/utils/parser.py @@ -163,7 +163,7 @@ def to_std(a): def to_int(a): if str(type(a)) == "": - return np.nan + return None elif isinstance(a, (int, float, np.int64)): return int(a) elif isinstance(a, pd.core.series.Series): @@ -811,9 +811,8 @@ def eval_metric(dfs, dfs_type, sys_info, raw_pmc_df, debug): # print("eval_metric", id, expr) try: out = eval(compile(row[expr], "", "eval")) - if row.name != "19.1.1" and np.isnan( - out - ): # Special exception for unique format of Active CUs in mem chart + + if np.isnan(out): row[expr] = "" else: row[expr] = out