Skip to content

Commit

Permalink
disp
Browse files Browse the repository at this point in the history
  • Loading branch information
rickwierenga committed Jan 11, 2025
1 parent ed12140 commit 94fdcdc
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pylabrobot/liquid_handling/liquid_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,16 +1017,13 @@ async def dispense(
# center of the resource.
if len(set(resources)) == 1:
resource = resources[0]
n = len(use_channels)
resources = [resource] * len(use_channels)
if resource.get_absolute_rotation().z % 180 == 0:
centers = list(reversed(resource.centers(yn=n, zn=0)))
elif resource.get_absolute_rotation().z % 90 == 0:
centers = list(reversed(resource.centers(xn=n, zn=0)))
else:
raise ValueError("Only 90 and 180 degree rotations are supported for now.")
centers = [c - resource.center() for c in centers] # offset is wrt center
offsets = [c + o for c, o in zip(centers, offsets)] # user-defined
center_offsets = self._get_single_resource_liquid_op_offsets(
resource=resource, num_channels=len(use_channels)
)

# add user defined offsets to the computed centers
offsets = [c + o for c, o in zip(center_offsets, offsets)]

tips = [self.head[channel].get_tip() for channel in use_channels]

Expand Down

0 comments on commit 94fdcdc

Please sign in to comment.