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): split backend tip_action into two functions #13381

Merged
merged 5 commits into from
Aug 30, 2023

Conversation

caila-marashaj
Copy link
Contributor

Overview

Currently, the backend tip_action function is used both for regular tip action moves, as well as for homing the gear motors at a constant velocity. This makes the code a little bit cluttered, as the backend function takes in either a list of moves or a distance and velocity to accommodate this, and then needs to determine which one it's received.

Instead, the api can just use two separate functions- one for homing, and one for all other moves involving the gear motor.

Changelog

  • create a home_gear_motors function in ot3api.py that fast homes the gear motors if possible, or homes at constant velocity if not
  • create a home_gear_motors function in ot3controller.py that is used only for homing at constant velocity
  • ot3controller.py::tip_action will only take in a list of moves

@caila-marashaj caila-marashaj requested a review from a team as a code owner August 24, 2023 20:11
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #13381 (bdcc6e6) into edge (5c3660f) will increase coverage by 0.00%.
Report is 1 commits behind head on edge.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #13381   +/-   ##
=======================================
  Coverage   71.67%   71.67%           
=======================================
  Files        2405     2405           
  Lines       67012    67010    -2     
  Branches     7654     7654           
=======================================
- Hits        48029    48028    -1     
+ Misses      17163    17162    -1     
  Partials     1820     1820           
Flag Coverage Δ
app 70.01% <ø> (ø)
components 61.44% <ø> (ø)
g-code-testing 96.44% <ø> (ø)
hardware-testing ∅ <ø> (∅)
labware-library 49.17% <ø> (ø)
notify-server 89.13% <ø> (ø)
protocol-designer 46.10% <ø> (ø)
react-api-client 70.11% <ø> (ø)

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

Files Changed Coverage Δ
...entrons/hardware_control/backends/ot3controller.py 68.42% <ø> (+0.21%) ⬆️
...pentrons/hardware_control/backends/ot3simulator.py 86.44% <ø> (ø)
...rc/opentrons/hardware_control/backends/ot3utils.py 94.23% <ø> (ø)
api/src/opentrons/hardware_control/ot3api.py 79.43% <ø> (ø)

Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

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

Make sure this is tested on a robot beforehand, but looks good overall.

Copy link
Contributor

@vegano1 vegano1 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,
go to go once we get some testing on the robot.

@caila-marashaj caila-marashaj merged commit d1ca451 into edge Aug 30, 2023
@caila-marashaj caila-marashaj deleted the tip-action-refactor branch August 30, 2023 21:45
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