Skip to content

Commit

Permalink
refactor for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni-t committed Aug 23, 2023
1 parent a46bda3 commit b684185
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/src/opentrons/protocol_engine/state/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,13 @@ def get_labware_grip_point(
)
location_slot: DeckSlotName

if isinstance(location, (ModuleLocation, OnLabwareLocation)):
if isinstance(location, DeckSlotLocation):
location_slot = location.slotName
offset = LabwareOffsetVector(x=0, y=0, z=0)
else:
if isinstance(location, ModuleLocation):
location_slot = self._modules.get_location(location.moduleId).slotName
else:
else: # OnLabwareLocation
location_slot = self.get_ancestor_slot_name(location.labwareId)
labware_offset = self._get_labware_position_offset(labware_id, location)
# Get the calibrated offset if the on labware location is on top of a module, otherwise return empty one
Expand All @@ -452,9 +455,6 @@ def get_labware_grip_point(
y=labware_offset.y + cal_offset.y,
z=labware_offset.z + cal_offset.z,
)
else:
location_slot = location.slotName
offset = LabwareOffsetVector(x=0, y=0, z=0)

slot_center = self._labware.get_slot_center_position(location_slot)
return Point(
Expand Down

0 comments on commit b684185

Please sign in to comment.