Skip to content

Commit 64b6804

Browse files
committed
STARBackend.pick_up_tips96 tip_pickup_method is a literal
1 parent 6f02bbd commit 64b6804

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,11 +2471,41 @@ async def dispense(
24712471
async def pick_up_tips96(
24722472
self,
24732473
pickup: PickupTipRack,
2474-
tip_pickup_method: int = 0,
2474+
tip_pickup_method: Literal["from_rack", "from_waste", "full_blowout"] = "from_rack",
24752475
minimum_height_command_end: Optional[float] = None,
24762476
minimum_traverse_height_at_beginning_of_a_command: Optional[float] = None,
24772477
):
2478-
"""Pick up tips using the 96 head."""
2478+
"""Pick up tips using the 96 head.
2479+
2480+
`tip_pickup_method` can be one of the following:
2481+
- "from_rack": standard tip pickup from a tip rack. this moves the plunger all the way down before mouting tips.
2482+
- "from_waste":
2483+
1. it actually moves the plunger all the way up
2484+
2. mounts tips
2485+
3. moves up like 10mm
2486+
4. moves plunger all the way down
2487+
5. moves to traversal height (tips out of rack)
2488+
- "full_blowout":
2489+
1. it actually moves the plunger all the way up
2490+
2. mounts tips
2491+
3. moves to traversal height (tips out of rack)
2492+
2493+
Args:
2494+
pickup: The standard `PickupTipRack` operation.
2495+
tip_pickup_method: The method to use for picking up tips. One of "from_rack", "from_waste", "full_blowout".
2496+
minimum_height_command_end: The minimum height to move to at the end of the command.
2497+
minimum_traverse_height_at_beginning_of_a_command: The minimum height to move to at the beginning of the command.
2498+
"""
2499+
2500+
if isinstance(tip_pickup_method, int):
2501+
warnings.warn(
2502+
"tip_pickup_method as int is deprecated and will be removed in the future. Use string literals instead.",
2503+
DeprecationWarning,
2504+
)
2505+
tip_pickup_method = {0: "from_rack", 1: "from_waste", 2: "full_blowout"}[tip_pickup_method]
2506+
2507+
if tip_pickup_method not in {"from_rack", "from_waste", "full_blowout"}:
2508+
raise ValueError(f"Invalid tip_pickup_method: '{tip_pickup_method}'.")
24792509

24802510
assert self.core96_head_installed, "96 head must be installed"
24812511

@@ -2516,7 +2546,11 @@ async def pick_up_tips96(
25162546
x_direction=0 if pickup_position.x >= 0 else 1,
25172547
y_position=round(pickup_position.y * 10),
25182548
tip_type_idx=ttti,
2519-
tip_pickup_method=tip_pickup_method,
2549+
tip_pickup_method={
2550+
"from_rack": 0,
2551+
"from_waste": 1,
2552+
"full_blowout": 2,
2553+
}[tip_pickup_method],
25202554
z_deposit_position=round(pickup_position.z * 10),
25212555
minimum_traverse_height_at_beginning_of_a_command=round(
25222556
(minimum_traverse_height_at_beginning_of_a_command or self._channel_traversal_height) * 10

0 commit comments

Comments
 (0)