Skip to content

Commit

Permalink
Add checkers for if values are float in show_all
Browse files Browse the repository at this point in the history
Signed-off-by: JoseSantosAMD <Jose.Santos@amd.com>
  • Loading branch information
JoseSantosAMD committed Aug 3, 2023
1 parent 80e6583 commit b62197f
Showing 1 changed file with 107 additions and 105 deletions.
212 changes: 107 additions & 105 deletions src/omniperf_analyze/utils/tty.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,112 +159,114 @@ def show_all(args, runs, archConfigs, output):
]
if not curr_row.empty:
if "Value" in curr_row:
if curr_row.Value[0] < 0.001:
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Unit",
] = "Kb/s"
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Value",
] = (
1000000
* curr_row.Value
)
elif curr_row.Value[0] < 1:
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Unit",
] = "Mb/s"
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Value",
] = (
1000 * curr_row.Value
)
if isinstance(curr_row["Value"][0], float):
if curr_row.Value[0] < 0.001:
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Unit",
] = "Kb/s"
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Value",
] = (
1000000
* curr_row.Value
)
elif curr_row.Value[0] < 1:
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Unit",
] = "Mb/s"
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Value",
] = (
1000 * curr_row.Value
)
elif "Avg" in curr_row:
if curr_row.Avg[0] < 0.001:
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Unit",
] = "Kb/s"
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Avg",
] = (
1000000 * curr_row.Avg
)
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Min",
] = (
1000000 * curr_row.Min
)
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Max",
] = (
1000000 * curr_row.Max
)
elif curr_row.Avg[0] < 1:
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Unit",
] = "Mb/s"
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Avg",
] = (
1000 * curr_row.Avg
)
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Min",
] = (
1000 * curr_row.Min
)
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Max",
] = (
1000 * curr_row.Max
)
if isinstance(curr_row["Avg"][0], float):
if curr_row.Avg[0] < 0.001:
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Unit",
] = "Kb/s"
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Avg",
] = (
1000000 * curr_row.Avg
)
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Min",
] = (
1000000 * curr_row.Min
)
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Max",
] = (
1000000 * curr_row.Max
)
elif curr_row.Avg[0] < 1:
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Unit",
] = "Mb/s"
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Avg",
] = (
1000 * curr_row.Avg
)
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Min",
] = (
1000 * curr_row.Min
)
cur_df.loc[
(
cur_df["Metric"]
== curr_metric
),
"Max",
] = (
1000 * curr_row.Max
)
df = pd.concat([df, cur_df[header]], axis=1)

if not df.empty:
Expand Down

0 comments on commit b62197f

Please sign in to comment.