Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

Commit 93895b1

Browse files
committed
Update error handling
1 parent 76c90d0 commit 93895b1

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

Exploring_Pegasus/biclique_embedding.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@
2727
import matplotlib.pyplot as plt
2828

2929
# Form the biclique
30-
N = int(sys.argv[1])
30+
args = sys.argv
31+
if len(args) <= 1:
32+
print("\nNo input provided. Please provide an integer.")
33+
exit(1)
34+
35+
try:
36+
N = int(args[1])
37+
except:
38+
print("\nIncorrect input argument. Please provide an integer.\n")
39+
exit(1)
40+
3141
nodes1 = np.arange(N)
3242
nodes2 = [chr(i + ord('a')) for i in range(N)]
3343
B = nx.Graph()

Exploring_Pegasus/clique_embedding.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@
2525
matplotlib.use("agg")
2626
import matplotlib.pyplot as plt
2727

28-
N = int(sys.argv[1])
28+
args = sys.argv
29+
if len(args) <= 1:
30+
print("\nNo input provided. Please provide an integer.")
31+
exit(1)
32+
33+
try:
34+
N = int(args[1])
35+
except:
36+
print("\nIncorrect input argument. Please provide an integer.\n")
37+
exit(1)
38+
2939
G = nx.complete_graph(N)
3040

3141
fig, axes = plt.subplots(nrows=1, ncols=3, figsize=(12, 6))

0 commit comments

Comments
 (0)