Skip to content

Commit 495cf63

Browse files
committed
added catching error wrongly specified ports
1 parent f0e6823 commit 495cf63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/axiomatic/pic_helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def plot_interactive_spectra(
122122
port_keys = []
123123
for key in spectra:
124124
if isinstance(key, str):
125+
ports = key.split(",")
126+
if len(ports) != 2:
127+
raise ValueError("Port keys must be in the format 'port_in,port_out' with exactly one comma.")
125128
port_keys.append((key.split(",")[0], key.split(",")[1]))
126129
elif isinstance(key, tuple):
127130
port_keys.append(key)

0 commit comments

Comments
 (0)