Skip to content

Commit 54e7e40

Browse files
committed
fix type
1 parent aaa4429 commit 54e7e40

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

Diff for: pylabrobot/liquid_handling/backends/hamilton/STAR.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -1577,8 +1577,8 @@ async def aspirate(
15771577
self._assert_valid_resources([op.resource for op in ops])
15781578

15791579
# correct volumes using the liquid class
1580-
for op, hlc in zip(ops, hamilton_liquid_classes):
1581-
op.volume = hlc.compute_corrected_volume(op.volume) if hlc is not None else op.volume
1580+
volumes = [hlc.compute_corrected_volume(op.volume) if hlc is not None else op.volume
1581+
for op, hlc in zip(ops, hamilton_liquid_classes)]
15821582

15831583
well_bottoms = [op.resource.get_absolute_location().z + op.offset.z + \
15841584
op.resource.material_z_thickness for op in ops]
@@ -1657,7 +1657,7 @@ async def aspirate(
16571657
x_positions=x_positions,
16581658
y_positions=y_positions,
16591659

1660-
aspiration_volumes=[round(op.volume * 10) for op in ops],
1660+
aspiration_volumes=[round(vol * 10) for vol in volumes],
16611661
lld_search_height=[round(lsh * 10) for lsh in lld_search_height],
16621662
clot_detection_height=[round(cd * 10) for cd in clot_detection_height],
16631663
liquid_surface_no_lld=[round(ls * 10) for ls in liquid_surfaces_no_lld],
@@ -1839,8 +1839,8 @@ async def dispense(
18391839
))
18401840

18411841
# correct volumes using the liquid class
1842-
for op, hlc in zip(ops, hamilton_liquid_classes):
1843-
op.volume = hlc.compute_corrected_volume(op.volume) if hlc is not None else op.volume
1842+
volumes = [hlc.compute_corrected_volume(op.volume) if hlc is not None else op.volume
1843+
for op, hlc in zip(ops, hamilton_liquid_classes)]
18441844

18451845
well_bottoms = [op.resource.get_absolute_location().z + op.offset.z + \
18461846
op.resource.material_z_thickness for op in ops]
@@ -1858,7 +1858,6 @@ async def dispense(
18581858
[_dispensing_mode_for_op(empty=empty[i], jet=jet[i], blow_out=blow_out[i])
18591859
for i in range(len(ops))]
18601860

1861-
dispense_volumes = [op.volume for op in ops]
18621861
pull_out_distance_transport_air = _fill_in_defaults(pull_out_distance_transport_air, [10.0]*n)
18631862
second_section_height = _fill_in_defaults(second_section_height, [3.2]*n)
18641863
second_section_ratio = _fill_in_defaults(second_section_ratio, [618.0]*n)
@@ -1907,7 +1906,7 @@ async def dispense(
19071906
y_positions=y_positions,
19081907

19091908
dispensing_mode=dispensing_modes,
1910-
dispense_volumes=[round(dv*10) for dv in dispense_volumes],
1909+
dispense_volumes=[round(vol*10) for vol in volumes],
19111910
lld_search_height=[round(lsh*10) for lsh in lld_search_height],
19121911
liquid_surface_no_lld=[round(ls*10) for ls in liquid_surfaces_no_lld],
19131912
pull_out_distance_transport_air=[round(po*10) for po in pull_out_distance_transport_air],

Diff for: pylabrobot/liquid_handling/backends/hamilton/vantage.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,8 @@ async def aspirate(
620620
self._assert_valid_resources([op.resource for op in ops])
621621

622622
# correct volumes using the liquid class
623-
for op, hlc in zip(ops, hlcs):
624-
op.volume = hlc.compute_corrected_volume(op.volume) if hlc is not None else op.volume
623+
volumes = [hlc.compute_corrected_volume(op.volume) if hlc is not None else op.volume
624+
for op, hlc in zip(ops, hlcs)]
625625

626626
well_bottoms = [op.resource.get_absolute_location().z + op.offset.z + \
627627
op.resource.material_z_thickness for op in ops]
@@ -663,7 +663,7 @@ async def aspirate(
663663
immersion_depth=[round(id_*10) for id_ in immersion_depth or [0]*len(ops)],
664664
surface_following_distance=[round(sfd*10) for sfd in surface_following_distance or
665665
[0]*len(ops)],
666-
aspiration_volume=[round(op.volume*100) for op in ops],
666+
aspiration_volume=[round(vol*100) for vol in volumes],
667667
aspiration_speed=[round(fr * 10) for fr in flow_rates],
668668
transport_air_volume=[round(tav*10) for tav in
669669
transport_air_volume or [hlc.aspiration_air_transport_volume if hlc is not None else 0
@@ -785,8 +785,8 @@ async def dispense(
785785
self._assert_valid_resources([op.resource for op in ops])
786786

787787
# correct volumes using the liquid class
788-
for op, hlc in zip(ops, hlcs):
789-
op.volume = hlc.compute_corrected_volume(op.volume) if hlc is not None else op.volume
788+
volumes = [hlc.compute_corrected_volume(op.volume) if hlc is not None else op.volume
789+
for op, hlc in zip(ops, hlcs)]
790790

791791
well_bottoms = [op.resource.get_absolute_location().z + op.offset.z + \
792792
op.resource.material_z_thickness for op in ops]
@@ -831,7 +831,7 @@ async def dispense(
831831
minimal_traverse_height_at_begin_of_command or [self._traversal_height]*len(ops)],
832832
minimal_height_at_command_end=
833833
[round(mh*10) for mh in minimal_height_at_command_end or [self._traversal_height]*len(ops)],
834-
dispense_volume=[round(op.volume * 100) for op in ops],
834+
dispense_volume=[round(vol*100) for vol in volumes],
835835
dispense_speed=[round(fr*10) for fr in flow_rates],
836836
cut_off_speed=[round(cs*10) for cs in cut_off_speed or [250]*len(ops)],
837837
stop_back_volume=[round(sbv*100) for sbv in stop_back_volume or [0]*len(ops)],

Diff for: pylabrobot/liquid_handling/backends/tecan/EVO.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,6 @@ async def aspirate(
317317
tip_type=op.tip.tip_type
318318
) if isinstance(op.tip, TecanTip) else None for op in ops]
319319

320-
for op, tlc in zip(ops, tecan_liquid_classes):
321-
op.volume = tlc.compute_corrected_volume(op.volume) if tlc is not None else op.volume
322-
323320
ys = int(ops[0].resource.get_absolute_size_y() * 10)
324321
zadd: List[Optional[int]] = [0] * self.num_channels
325322
for i, channel in enumerate(use_channels):
@@ -406,11 +403,6 @@ async def dispense(
406403
tip_type=op.tip.tip_type
407404
) if isinstance(op.tip, TecanTip) else None for op in ops]
408405

409-
for op, tlc in zip(ops, tecan_liquid_classes):
410-
op.volume = tlc.compute_corrected_volume(op.volume) + \
411-
tlc.aspirate_lag_volume + tlc.aspirate_tag_volume \
412-
if tlc is not None else op.volume
413-
414406
x, _ = self._first_valid(x_positions)
415407
y, yi = self._first_valid(y_positions)
416408
assert x is not None and y is not None
@@ -724,7 +716,8 @@ def _aspirate_action(
724716
assert tlc is not None and z is not None
725717
sep[channel] = int(tlc.aspirate_speed * 12) # 6?
726718
ssz[channel] = round(z * tlc.aspirate_speed / ops[i].volume)
727-
mtr[channel] = round(ops[i].volume * 6) # 3?
719+
volume = tlc.compute_corrected_volume(ops[i].volume)
720+
mtr[channel] = round(volume * 6) # 3?
728721
ssz_r[channel] = int(tlc.aspirate_retract_speed * 10)
729722

730723
return ssz, sep, stz, mtr, ssz_r
@@ -755,7 +748,9 @@ def _dispense_action(
755748
sep[channel] = int(tlc.dispense_speed * 12) # 6?
756749
spp[channel] = int(tlc.dispense_breakoff * 12) # 6?
757750
stz[channel] = 0
758-
mtr[channel] = -round(ops[i].volume * 6) # 3?
751+
volume = tlc.compute_corrected_volume(ops[i].volume) + tlc.aspirate_lag_volume + \
752+
tlc.aspirate_tag_volume
753+
mtr[channel] = -round(volume * 6) # 3?
759754

760755
return sep, spp, stz, mtr
761756

0 commit comments

Comments
 (0)