Skip to content

Commit bb08618

Browse files
committed
added handling wrong type of input
1 parent 495cf63 commit bb08618

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/axiomatic/pic_helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def plot_interactive_spectra(
108108
Creates an interactive plot of spectra with a slider to select different indices.
109109
Parameters:
110110
-----------
111-
spectra : list of list of float
111+
spectra : list of list of float or a dictionary with tuple or string keys
112112
A list of spectra, where each spectrum is a list of lists of float values, each
113113
corresponding to the transmission of a single wavelength.
114114
wavelengths : list of float
@@ -128,6 +128,8 @@ def plot_interactive_spectra(
128128
port_keys.append((key.split(",")[0], key.split(",")[1]))
129129
elif isinstance(key, tuple):
130130
port_keys.append(key)
131+
else:
132+
raise ValueError("Port keys must be either a string or a tuple.")
131133

132134
# Defaults
133135
if spectrum_labels is None and isinstance(spectra, dict):

0 commit comments

Comments
 (0)