opentrons icon indicating copy to clipboard operation
opentrons copied to clipboard

fix(papi-v2): do not raise h/s movement flagger for point-only destinations

Open sanni-t opened this issue 3 years ago • 1 comments

Closes RSS-67

Overview

Fixes a bug that would raise h/s movement error for locations that had no slots associated with them (like absolute deck coordinates). It resulted in errors being raised for destinations that were actually not close to the h/s. So we'll take a lenient approach and just log a warning if we can't say for sure that the pipette will collide with h/s.

I decided on this approach since:

  • use of absolute coordinates that don't have a loaded labware associated with them is not a common use case in protocols, and when they are actually used, we can't guarantee safe movement in many situations so we already rely on the user making well-planned movement decisions.
  • internally, a move_to with absolute coordinates is only used in thermocycler's movement flagger to move pipettes to a point over the trash
  • Protocol engine's move_to_coordinates also doesn't raise any similar errors

Such situations point to the need for a better collision prevention logic but until it's implemented, we'll assume that the protocol writer knows that the pipette will not collide with the h/s when moving pipettes to locations like absolute coordinates. We use a similar approach for thermocycler's movement flagger.

Changelog

  • replaced error raising with logging a warning when destination slot is undefined.
  • added test

Review requests

  • Please verify that this doesn't change any other pipette restriction behavior
  • Check if there are any other 'destination' cases I've missed

Risk assessment

Medium. Allows pipettes to perform a potentially harmful move. But using absolute coordinates is rare so this should be fine as long as there aren't any other commonly-used scenarios that also perform move_tos with a location that's not associated with a labware.

sanni-t avatar Aug 12 '22 05:08 sanni-t

Codecov Report

Merging #11335 (c0d5504) into release_6.1.0 (b3d533c) will increase coverage by 0.22%. The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                @@
##           release_6.1.0   #11335      +/-   ##
=================================================
+ Coverage          71.87%   72.10%   +0.22%     
=================================================
  Files               1048     1065      +17     
  Lines              17151    17382     +231     
  Branches            3710     3710              
=================================================
+ Hits               12328    12534     +206     
- Misses              3857     3882      +25     
  Partials             966      966              
Flag Coverage Δ
app 73.72% <ø> (ø)
notify-server 89.17% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
notify-server/notify_server/network/connection.py 100.00% <0.00%> (ø)
notify-server/notify_server/server/__init__.py 100.00% <0.00%> (ø)
notify-server/notify_server/models/topics.py 0.00% <0.00%> (ø)
notify-server/notify_server/server/server.py 100.00% <0.00%> (ø)
notify-server/notify_server/logging.py 85.71% <0.00%> (ø)
notify-server/notify_server/app_sub.py 0.00% <0.00%> (ø)
...er/notify_server/models/hardware_event/__init__.py 100.00% <0.00%> (ø)
...erver/notify_server/models/hardware_event/names.py 100.00% <0.00%> (ø)
.../notify_server/models/hardware_event/door_state.py 100.00% <0.00%> (ø)
notify-server/notify_server/models/payload_type.py 100.00% <0.00%> (ø)
... and 7 more

codecov[bot] avatar Aug 12 '22 05:08 codecov[bot]