Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
rickwierenga committed Sep 18, 2024
1 parent aaa4429 commit 54e7e40
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
13 changes: 6 additions & 7 deletions pylabrobot/liquid_handling/backends/hamilton/STAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,8 +1577,8 @@ async def aspirate(
self._assert_valid_resources([op.resource for op in ops])

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

well_bottoms = [op.resource.get_absolute_location().z + op.offset.z + \
op.resource.material_z_thickness for op in ops]
Expand Down Expand Up @@ -1657,7 +1657,7 @@ async def aspirate(
x_positions=x_positions,
y_positions=y_positions,

aspiration_volumes=[round(op.volume * 10) for op in ops],
aspiration_volumes=[round(vol * 10) for vol in volumes],
lld_search_height=[round(lsh * 10) for lsh in lld_search_height],
clot_detection_height=[round(cd * 10) for cd in clot_detection_height],
liquid_surface_no_lld=[round(ls * 10) for ls in liquid_surfaces_no_lld],
Expand Down Expand Up @@ -1839,8 +1839,8 @@ async def dispense(
))

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

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

dispense_volumes = [op.volume for op in ops]
pull_out_distance_transport_air = _fill_in_defaults(pull_out_distance_transport_air, [10.0]*n)
second_section_height = _fill_in_defaults(second_section_height, [3.2]*n)
second_section_ratio = _fill_in_defaults(second_section_ratio, [618.0]*n)
Expand Down Expand Up @@ -1907,7 +1906,7 @@ async def dispense(
y_positions=y_positions,

dispensing_mode=dispensing_modes,
dispense_volumes=[round(dv*10) for dv in dispense_volumes],
dispense_volumes=[round(vol*10) for vol in volumes],
lld_search_height=[round(lsh*10) for lsh in lld_search_height],
liquid_surface_no_lld=[round(ls*10) for ls in liquid_surfaces_no_lld],
pull_out_distance_transport_air=[round(po*10) for po in pull_out_distance_transport_air],
Expand Down
12 changes: 6 additions & 6 deletions pylabrobot/liquid_handling/backends/hamilton/vantage.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@ async def aspirate(
self._assert_valid_resources([op.resource for op in ops])

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

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

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

well_bottoms = [op.resource.get_absolute_location().z + op.offset.z + \
op.resource.material_z_thickness for op in ops]
Expand Down Expand Up @@ -831,7 +831,7 @@ async def dispense(
minimal_traverse_height_at_begin_of_command or [self._traversal_height]*len(ops)],
minimal_height_at_command_end=
[round(mh*10) for mh in minimal_height_at_command_end or [self._traversal_height]*len(ops)],
dispense_volume=[round(op.volume * 100) for op in ops],
dispense_volume=[round(vol*100) for vol in volumes],
dispense_speed=[round(fr*10) for fr in flow_rates],
cut_off_speed=[round(cs*10) for cs in cut_off_speed or [250]*len(ops)],
stop_back_volume=[round(sbv*100) for sbv in stop_back_volume or [0]*len(ops)],
Expand Down
15 changes: 5 additions & 10 deletions pylabrobot/liquid_handling/backends/tecan/EVO.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ async def aspirate(
tip_type=op.tip.tip_type
) if isinstance(op.tip, TecanTip) else None for op in ops]

for op, tlc in zip(ops, tecan_liquid_classes):
op.volume = tlc.compute_corrected_volume(op.volume) if tlc is not None else op.volume

ys = int(ops[0].resource.get_absolute_size_y() * 10)
zadd: List[Optional[int]] = [0] * self.num_channels
for i, channel in enumerate(use_channels):
Expand Down Expand Up @@ -406,11 +403,6 @@ async def dispense(
tip_type=op.tip.tip_type
) if isinstance(op.tip, TecanTip) else None for op in ops]

for op, tlc in zip(ops, tecan_liquid_classes):
op.volume = tlc.compute_corrected_volume(op.volume) + \
tlc.aspirate_lag_volume + tlc.aspirate_tag_volume \
if tlc is not None else op.volume

x, _ = self._first_valid(x_positions)
y, yi = self._first_valid(y_positions)
assert x is not None and y is not None
Expand Down Expand Up @@ -724,7 +716,8 @@ def _aspirate_action(
assert tlc is not None and z is not None
sep[channel] = int(tlc.aspirate_speed * 12) # 6?
ssz[channel] = round(z * tlc.aspirate_speed / ops[i].volume)
mtr[channel] = round(ops[i].volume * 6) # 3?
volume = tlc.compute_corrected_volume(ops[i].volume)
mtr[channel] = round(volume * 6) # 3?
ssz_r[channel] = int(tlc.aspirate_retract_speed * 10)

return ssz, sep, stz, mtr, ssz_r
Expand Down Expand Up @@ -755,7 +748,9 @@ def _dispense_action(
sep[channel] = int(tlc.dispense_speed * 12) # 6?
spp[channel] = int(tlc.dispense_breakoff * 12) # 6?
stz[channel] = 0
mtr[channel] = -round(ops[i].volume * 6) # 3?
volume = tlc.compute_corrected_volume(ops[i].volume) + tlc.aspirate_lag_volume + \
tlc.aspirate_tag_volume
mtr[channel] = -round(volume * 6) # 3?

return sep, spp, stz, mtr

Expand Down

0 comments on commit 54e7e40

Please sign in to comment.