@@ -1166,7 +1166,11 @@ def load_liquid(
1166
1166
well_names .append (well .well_name )
1167
1167
else :
1168
1168
raise TypeError (
1169
- "The elements of wells should be Well instances or well names."
1169
+ f"Unexpected type for element { repr (well )} . The elements of wells should be Well instances or well names."
1170
+ )
1171
+ if not isinstance (volume , (float , int )):
1172
+ raise TypeError (
1173
+ f"Unexpected type for volume { repr (volume )} . Volume should be a number in microliters."
1170
1174
)
1171
1175
self ._core .load_liquid ({well_name : volume for well_name in well_names }, liquid )
1172
1176
@@ -1211,7 +1215,11 @@ def load_liquid_by_well(
1211
1215
verified_volumes [well .well_name ] = volume
1212
1216
else :
1213
1217
raise TypeError (
1214
- "The elements of wells should be Well instances or well names."
1218
+ f"Unexpected type for well name { repr (well )} . The keys of volumes should be Well instances or well names."
1219
+ )
1220
+ if not isinstance (volume , (float , int )):
1221
+ raise TypeError (
1222
+ f"Unexpected type for volume { repr (volume )} . The values of volumes should be numbers in microliters."
1215
1223
)
1216
1224
self ._core .load_liquid (verified_volumes , liquid )
1217
1225
@@ -1235,18 +1243,18 @@ def load_empty(self, wells: Sequence[Union[Well, str]]) -> None:
1235
1243
if isinstance (well , str ):
1236
1244
if well not in self :
1237
1245
raise KeyError (
1238
- " The elements of wells should name wells in this labware."
1246
+ f" { well } is not a well in { self . name } . The elements of wells should name wells in this labware."
1239
1247
)
1240
1248
well_names .append (well )
1241
1249
elif isinstance (well , Well ):
1242
1250
if well .parent is not self :
1243
1251
raise KeyError (
1244
- " The elements of wells should be wells of this labware."
1252
+ f" { well . well_name } is not a well in { self . name } . The elements of wells should be wells of this labware."
1245
1253
)
1246
1254
well_names .append (well .well_name )
1247
1255
else :
1248
1256
raise TypeError (
1249
- " The elements of wells should be Well instances or well names."
1257
+ f"Unexpected type for well name { repr ( well ) } . The elements of wells should be Well instances or well names."
1250
1258
)
1251
1259
self ._core .load_empty (well_names )
1252
1260
0 commit comments