Skip to content

Commit

Permalink
cleanup and location error case
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyBatten authored and Laura-Danielle committed Oct 2, 2024
1 parent 110af80 commit 720290a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions api/src/opentrons/protocol_api/robot_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,22 @@ def axis_coordinates_for(
top_of_labware = loc.wells()[0].top()
loc = top_of_labware.point
return {mount_axis: loc.z, AxisType.X: loc.x, AxisType.Y: loc.y}
elif location is DeckLocation:
assert not isinstance(location, Location)
elif location is DeckLocation and not isinstance(location, Location):
slot_name = validation.ensure_and_convert_deck_slot(
location,
api_version=self._api_version,
robot_type=self._protocol_core.robot_type,
)
loc = self._protocol_core.get_slot_center(slot_name)
return {mount_axis: loc.z, AxisType.X: loc.x, AxisType.Y: loc.y}
else:
elif isinstance(location, Location):
assert isinstance(location, Location)
loc = location.point
return {mount_axis: loc.z, AxisType.X: loc.x, AxisType.Y: loc.y}
else:
raise ValueError(
"Location parameter must be a Module, Deck Location, or Location type."
)
else:
raise TypeError("You must specify a location to move to.")

Expand Down

0 comments on commit 720290a

Please sign in to comment.