Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser: to_int() return None instead of np.nan (#569) #583

Open
wants to merge 1 commit into
base: release/rocm-rel-6.4
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/utils/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def to_std(a):

def to_int(a):
if str(type(a)) == "<class 'NoneType'>":
return np.nan
return None
elif isinstance(a, (int, float, np.int64)):
return int(a)
elif isinstance(a, pd.core.series.Series):
Expand Down Expand Up @@ -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], "<string>", "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
Expand Down
Loading