Skip to content

Commit 603d261

Browse files
committed
admit comma separated port keys
1 parent d2ca775 commit 603d261

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/axiomatic/pic_helpers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ def plot_interactive_spectra(
121121

122122
# Defaults
123123
if spectrum_labels is None and isinstance(spectra, dict):
124+
if isinstance(list(spectra.keys())[0], str) and all("," in key for key in spectra.keys()):
125+
spectrum_labels = [f"T {port_in} -> {port_out}" for port_in, port_out in spectra.keys()]
126+
elif isinstance(list(spectra.keys())[0], tuple) and len(list(spectra.keys())[0]) == 2:
124127
spectrum_labels = [f"T {port_in} -> {port_out}" for port_in, port_out in spectra.keys()]
128+
125129
elif spectrum_labels is None:
126130
spectrum_labels = [f"Spectrum {i}" for i in range(len(spectra))]
127131
if vlines is None:

0 commit comments

Comments
 (0)