Skip to content

Commit 0353a67

Browse files
authored
Revert "hamilton liquid classes make kwargs (#248)" (#264)
This reverts commit fbb08be.
1 parent 6542154 commit 0353a67

File tree

8 files changed

+453
-255
lines changed

8 files changed

+453
-255
lines changed

CHANGELOG.md

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
3838
- Move `LiquidHandlerChatterboxBackend` from `liquid_handling.backends.chatterbox_backend` to `liquid_handling.backends.chatterbox` (https://github.com/PyLabRobot/pylabrobot/pull/242)
3939
- Changed `pedestal_size_z=-5` to `pedestal_size_z=-4.74` for `PLT_CAR_L5AC_A00` (https://github.com/PyLabRobot/pylabrobot/pull/255)
4040
- rename `homogenization_` parameters in `STAR` to `mix_` (https://github.com/PyLabRobot/pylabrobot/pull/261)
41-
- Hamilton liquid classes are no longer automatically inferred on the backends (`STAR`/`Vantage`). Instead, they create kwargs with `make_(asp|disp)(96)?_kwargs` (https://github.com/PyLabRobot/pylabrobot/pull/248)
42-
- This also applies to volume correction curves, which are now the users' responsibility.
4341

4442
### Added
4543

pylabrobot/liquid_handling/backends/hamilton/STAR.py

+204-76
Large diffs are not rendered by default.

pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py

+13-41
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
from pylabrobot.liquid_handling import LiquidHandler
66
from pylabrobot.liquid_handling.standard import Pickup, GripDirection
7-
from pylabrobot.liquid_handling.liquid_classes.hamilton.star import (
8-
StandardVolumeFilter_Water_DispenseSurface,
9-
StandardVolumeFilter_Water_DispenseJet_Empty,
10-
HighVolumeFilter_96COREHead1000ul_Water_DispenseSurface_Empty)
117
from pylabrobot.plate_reading import PlateReader
128
from pylabrobot.plate_reading.plate_reader_tests import MockPlateReaderBackend
139
from pylabrobot.resources import (
@@ -228,10 +224,6 @@ def __init__(self, name: str):
228224

229225
await self.lh.setup()
230226

231-
self.hlc = StandardVolumeFilter_Water_DispenseSurface.copy()
232-
self.hlc.aspiration_air_transport_volume = 0
233-
self.hlc.dispense_air_transport_volume = 0
234-
235227
async def asyncTearDown(self):
236228
await self.lh.stop()
237229

@@ -378,9 +370,7 @@ async def test_aspirate56(self):
378370
self.plate.lid.unassign()
379371
for well in self.plate.get_items(["A1", "B1"]):
380372
well.tracker.set_liquids([(None, 100 * 1.072)]) # liquid class correction
381-
corrected_vol = self.hlc.compute_corrected_volume(100)
382-
await self.lh.aspirate(self.plate["A1", "B1"], vols=[corrected_vol, corrected_vol],
383-
use_channels=[4, 5], **self.hlc.make_asp_kwargs(2))
373+
await self.lh.aspirate(self.plate["A1", "B1"], vols=[100, 100], use_channels=[4, 5])
384374
self._assert_command_sent_once("C0ASid0004at0 0 0 0 0 0 0&tm0 0 0 0 1 1 0&xp00000 00000 00000 "
385375
"00000 02983 02983 00000&yp0000 0000 0000 0000 1457 1367 0000&th2450te2450lp2000 2000 2000 "
386376
"2000 2000 2000 2000&ch000 000 000 000 000 000 000&zl1866 1866 1866 1866 1866 1866 1866&"
@@ -404,8 +394,7 @@ async def test_single_channel_aspiration(self):
404394
self.plate.lid.unassign()
405395
well = self.plate.get_item("A1")
406396
well.tracker.set_liquids([(None, 100 * 1.072)]) # liquid class correction
407-
await self.lh.aspirate([well], vols=[self.hlc.compute_corrected_volume(100)],
408-
**self.hlc.make_asp_kwargs(1))
397+
await self.lh.aspirate([well], vols=[100])
409398

410399
# This passes the test, but is not the real command.
411400
self._assert_command_sent_once(
@@ -424,8 +413,7 @@ async def test_single_channel_aspiration_liquid_height(self):
424413
self.plate.lid.unassign()
425414
well = self.plate.get_item("A1")
426415
well.tracker.set_liquids([(None, 100 * 1.072)]) # liquid class correction
427-
await self.lh.aspirate([well], vols=[self.hlc.compute_corrected_volume(100)],
428-
liquid_height=[10], **self.hlc.make_asp_kwargs(1))
416+
await self.lh.aspirate([well], vols=[100], liquid_height=[10])
429417

430418
# This passes the test, but is not the real command.
431419
self._assert_command_sent_once(
@@ -445,9 +433,7 @@ async def test_multi_channel_aspiration(self):
445433
wells = self.plate.get_items("A1:B1")
446434
for well in wells:
447435
well.tracker.set_liquids([(None, 100 * 1.072)]) # liquid class correction
448-
corrected_vol = self.hlc.compute_corrected_volume(100)
449-
await self.lh.aspirate(self.plate["A1:B1"], vols=[corrected_vol]*2,
450-
**self.hlc.make_asp_kwargs(2))
436+
await self.lh.aspirate(self.plate["A1:B1"], vols=[100]*2)
451437

452438
# This passes the test, but is not the real command.
453439
self._assert_command_sent_once(
@@ -463,10 +449,8 @@ async def test_multi_channel_aspiration(self):
463449

464450
async def test_aspirate_single_resource(self):
465451
self.lh.update_head_state({i: self.tip_rack.get_tip(i) for i in range(5)})
466-
corrected_vol = self.hlc.compute_corrected_volume(10)
467452
with no_volume_tracking():
468-
await self.lh.aspirate([self.bb]*5,vols=[corrected_vol]*5, use_channels=[0,1,2,3,4],
469-
liquid_height=[1]*5, **self.hlc.make_asp_kwargs(5))
453+
await self.lh.aspirate([self.bb]*5,vols=[10]*5, use_channels=[0,1,2,3,4], liquid_height=[1]*5)
470454
self._assert_command_sent_once(
471455
"C0ASid0002at0 0 0 0 0 0&tm1 1 1 1 1 0&xp04865 04865 04865 04865 04865 00000&yp2098 1962 "
472456
"1825 1688 1552 0000&th2450te2450lp2000 2000 2000 2000 2000 2000&ch000 000 000 000 000 000&"
@@ -485,11 +469,9 @@ async def test_aspirate_single_resource(self):
485469

486470
async def test_dispense_single_resource(self):
487471
self.lh.update_head_state({i: self.tip_rack.get_tip(i) for i in range(5)})
488-
hlc = StandardVolumeFilter_Water_DispenseJet_Empty
489-
corrected_vol = hlc.compute_corrected_volume(10)
490472
with no_volume_tracking():
491-
await self.lh.dispense([self.bb]*5, vols=[corrected_vol]*5, liquid_height=[1]*5,
492-
jet=[True]*5, blow_out=[True]*5, **hlc.make_disp_kwargs(5))
473+
await self.lh.dispense([self.bb]*5, vols=[10]*5, use_channels=[0,1,2,3,4],
474+
liquid_height=[1]*5, blow_out=[True]*5, jet=[True]*5)
493475
self._assert_command_sent_once(
494476
"C0DSid0002dm1 1 1 1 1 1&tm1 1 1 1 1 0&xp04865 04865 04865 04865 04865 00000&yp2098 1962 "
495477
"1825 1688 1552 0000&zx1200 1200 1200 1200 1200 1200&lp2000 2000 2000 2000 2000 2000&zl1210 "
@@ -507,11 +489,8 @@ async def test_single_channel_dispense(self):
507489
self.lh.update_head_state({0: self.tip_rack.get_tip("A1")})
508490
assert self.plate.lid is not None
509491
self.plate.lid.unassign()
510-
hlc = StandardVolumeFilter_Water_DispenseJet_Empty
511-
corrected_vol = hlc.compute_corrected_volume(100)
512492
with no_volume_tracking():
513-
await self.lh.dispense(self.plate["A1"], vols=[corrected_vol], jet=[True], blow_out=[True],
514-
**hlc.make_disp_kwargs(1))
493+
await self.lh.dispense(self.plate["A1"], vols=[100], jet=[True], blow_out=[True])
515494
self._assert_command_sent_once(
516495
"C0DSid0002dm1 1&tm1 0&xp02983 00000&yp1457 0000&zx1866 1866&lp2000 2000&zl1866 1866&"
517496
"po0100 0100&ip0000 0000&it0 0&fp0000 0000&zu0032 0032&zr06180 06180&th2450te2450"
@@ -525,11 +504,8 @@ async def test_multi_channel_dispense(self):
525504
# TODO: Hamilton liquid classes
526505
assert self.plate.lid is not None
527506
self.plate.lid.unassign()
528-
hlc = StandardVolumeFilter_Water_DispenseJet_Empty
529-
corrected_vol = hlc.compute_corrected_volume(100)
530507
with no_volume_tracking():
531-
await self.lh.dispense(self.plate["A1:B1"], vols=[corrected_vol]*2, jet=[True]*2,
532-
blow_out=[True]*2, **hlc.make_disp_kwargs(2))
508+
await self.lh.dispense(self.plate["A1:B1"], vols=[100]*2, jet=[True]*2, blow_out=[True]*2)
533509

534510
self._assert_command_sent_once(
535511
"C0DSid0002dm1 1 1&tm1 1 0&xp02983 02983 00000&yp1457 1367 0000&zx1866 1866 1866&lp2000 2000 "
@@ -577,9 +553,7 @@ async def test_core_96_aspirate(self):
577553
# TODO: Hamilton liquid classes
578554
assert self.plate.lid is not None
579555
self.plate.lid.unassign()
580-
hlc = HighVolumeFilter_96COREHead1000ul_Water_DispenseSurface_Empty
581-
corrected_volume = hlc.compute_corrected_volume(100)
582-
await self.lh.aspirate96(self.plate, volume=corrected_volume, **hlc.make_asp96_kwargs())
556+
await self.lh.aspirate96(self.plate, volume=100, blow_out=True)
583557

584558
# volume used to be 01072, but that was generated using a non-core liquid class.
585559
self._assert_command_sent_once(
@@ -594,14 +568,12 @@ async def test_core_96_dispense(self):
594568
await self.lh.pick_up_tips96(self.tip_rack2) # pick up high volume tips
595569
if self.plate.lid is not None:
596570
self.plate.lid.unassign()
597-
hlc = HighVolumeFilter_96COREHead1000ul_Water_DispenseSurface_Empty
598-
corrected_volume = hlc.compute_corrected_volume(100)
599-
await self.lh.aspirate96(self.plate, corrected_volume, **hlc.make_asp96_kwargs())
571+
await self.lh.aspirate96(self.plate, 100, blow_out=True) # aspirate first
600572

601573
with no_volume_tracking():
602-
await self.lh.dispense96(self.plate, corrected_volume, blow_out=True,
603-
**hlc.make_disp96_kwargs())
574+
await self.lh.dispense96(self.plate, 100, blow_out=True)
604575

576+
# volume used to be 01072, but that was generated using a non-core liquid class.
605577
self._assert_command_sent_once(
606578
"C0EDid0001da3xs02983xd0yh1457zh2450ze2450lz1999zt1866zm1866iw000ix0fh000df01083dg1200vt050"
607579
"bv00000cm0cs1bs0020wh00hv00000hc00hp000hs1200es0050ev000zv0032ej00zq06180mj000cj0cx0cr000"

0 commit comments

Comments
 (0)