Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(api): improve labware movement code #13174

Merged
merged 8 commits into from
Jul 27, 2023

Conversation

sanni-t
Copy link
Member

@sanni-t sanni-t commented Jul 26, 2023

Overview

Last refactoring (ish) PR before I add the contextual gripper offsets. This makes updating the code much easier!

Test Plan

  • Test on a robot- even better, mimic labware movements from the science protocols on the robot to make sure everything still works correctly.

Changelog

  • compartmentalizes the labware movement code to make it easier to test
  • the only functional change is removal of the gripper Z-home commands before each move_to to the gripper Z home position. See RLAB-215 for more info. With RLAB-211 fixed, there doesn't seem to be a need to issue a home command before moving to gripper Z each time

Review requests

  • Mainly just- does the refactor make sense? any other improvements I should make?
  • I have tried to preserve tests as is so that I can catch any unintended changes. Caught one outdated value in the tests that we were just not using so that's good and is reassuring that tests work
  • @ahiuchingau do you think removing any of the homes before the move to gripper Z home position cause any issues?

Risk assessment

Low since tests

@sanni-t sanni-t requested a review from a team as a code owner July 26, 2023 19:41
@sanni-t sanni-t requested a review from ahiuchingau July 26, 2023 19:41
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #13174 (369358d) into internal-release_0.14.0 (57b7c9b) will increase coverage by 0.05%.
Report is 5 commits behind head on internal-release_0.14.0.
The diff coverage is n/a.

Impacted file tree graph

@@                     Coverage Diff                     @@
##           internal-release_0.14.0   #13174      +/-   ##
===========================================================
+ Coverage                    72.53%   72.59%   +0.05%     
===========================================================
  Files                         2359     2372      +13     
  Lines                        64994    65408     +414     
  Branches                      7213     7209       -4     
===========================================================
+ Hits                         47143    47482     +339     
- Misses                       16105    16181      +76     
+ Partials                      1746     1745       -1     
Flag Coverage Δ
g-code-testing 96.44% <ø> (ø)
notify-server 89.13% <ø> (ø)

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

Files Changed Coverage Δ
api/src/opentrons/motion_planning/__init__.py 100.00% <ø> (ø)
api/src/opentrons/motion_planning/types.py 100.00% <ø> (ø)
api/src/opentrons/motion_planning/waypoints.py 100.00% <ø> (ø)
...rc/opentrons/protocol_engine/execution/movement.py 100.00% <ø> (ø)
...pi/src/opentrons/protocol_engine/state/geometry.py 100.00% <ø> (ø)
api/src/opentrons/protocol_engine/types.py 97.56% <ø> (-0.10%) ⬇️

... and 15 files with indirect coverage changes

Copy link
Contributor

@ahiuchingau ahiuchingau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

I think removing the home commands should be fine

Copy link
Contributor

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me. Discussed in-person: we'll QA the home() vs. move_to() thing.

api/src/opentrons/motion_planning/types.py Outdated Show resolved Hide resolved
@sanni-t
Copy link
Member Author

sanni-t commented Jul 26, 2023

Tested moving labware between all modules and deck on a QA bot and it worked exactly the same as before the change.

@sanni-t sanni-t changed the base branch from edge to internal-release_0.14.0 July 26, 2023 22:02
@sanni-t sanni-t merged commit 01c1b02 into internal-release_0.14.0 Jul 27, 2023
25 checks passed
@sanni-t sanni-t deleted the api-refactor_labware_movement branch July 30, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants