Skip to content

Commit 690662e

Browse files
committed
Add else branches to all if statements in plot_violin.py with explanatory comments
1 parent f0895df commit 690662e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

graph_net/plot_violin.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,19 @@ def main():
107107
speedup_numeric = speedup_raw.get("e2e")
108108
elif isinstance(speedup_raw, (float, int)):
109109
speedup_numeric = speedup_raw
110+
else:
111+
# speedup_raw is neither dict nor numeric (e.g., None, empty dict, or other types)
112+
# Skip this sample as it doesn't contain valid speedup data
113+
continue
110114

111115
# Only process positive numeric speedup values (log2 requires positive values)
112116
if isinstance(speedup_numeric, (float, int)) and speedup_numeric > 0:
113117
plot_data["log2(speedup)"].append(np.log2(float(speedup_numeric)))
114118
plot_data["Category"].append(category_name)
119+
else:
120+
# speedup_numeric is None, non-numeric, or non-positive
121+
# Skip this sample as it doesn't have a valid positive speedup value for log2 calculation
122+
continue
115123

116124
if not plot_data["log2(speedup)"]:
117125
print("Error: No valid speedup data was found. Exiting.")

0 commit comments

Comments
 (0)