Skip to content

Commit e61a3cb

Browse files
committed
added list of available plate names to ValueError message when plate name not found
1 parent 111e096 commit e61a3cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/alhambra_mixes/references.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def plate_map(
8686
"""
8787
well_to_strand_name = {}
8888
found_plate_name = False
89+
available_plate_names = []
8990
for row in self.df.itertuples():
91+
available_plate_names.append(row.Plate)
9092
if row.Plate == name: # type: ignore
9193
found_plate_name = True
9294
well = row.Well # type: ignore
@@ -95,7 +97,8 @@ def plate_map(
9597
well_to_strand_name[well] = strand.name
9698

9799
if not found_plate_name:
98-
raise ValueError(f'Plate "{name}" not found in reference file.')
100+
raise ValueError(f'Plate "{name}" not found in reference file.'
101+
f'\nAvailable plate names: {", ".join(available_plate_names)}')
99102

100103
plate_map = PlateMap(
101104
plate_name=name,

0 commit comments

Comments
 (0)