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

feat(robot-server,app): extend pipette offset cal to include tip length cal if needed #6641

Merged
merged 22 commits into from
Oct 7, 2020

Conversation

b-cooper
Copy link
Contributor

Overview

Add functionality to the pipette offset calibration user flow to allow a user to set the tip length
for the pipette-tip combination that they intend to use for the pipette offset calibration. Add
branching and assertion logic to guide the state transitions in the user flow accordingly. Also add
the last of the tip length cal child components to the shared calibration panels and map to them
from the new pipette offset calibration states when appropriate.

Closes #6420

Changelog

Review requests

  • Try running Pipette Offset calibration without a tip length cal value for the tip rack. Should perform TLC then Pip offset
  • Try running Pipette Offset calibration with existing tip length cal value for the tip rack. Should behave as it did before
  • Ensure Tip Length cal standalone flow still functions as expected.

Risk assessment

low risk, code still behind feature flag, though pipette offset and tip length cal flows were both effected

…th cal if needed

Add functionality to the pipette offset calibration user flow to allow a user to set the tip length
for the pipette-tip combination that they intend to use for the pipette offset calibration. Add
branching and assertion logic to guide the state transitions in the user flow accordingly. Also add
the last of the tip length cal child components to the shared calibration panels and map to them
from the new pipette offset calibration states when appropriate.

Closes #6420
@b-cooper b-cooper marked this pull request as ready for review September 28, 2020 16:26
@b-cooper b-cooper requested review from a team as code owners September 28, 2020 16:26
@b-cooper b-cooper requested review from shlokamin, a team and ahiuchingau and removed request for a team September 28, 2020 16:26
@b-cooper b-cooper added app Affects the `app` project hmg hardware, motion, and geometry robot server Affects the `robot-server` project labels Sep 28, 2020
# recache tip length cal which has just been saved
self._has_calibrated_tip_length: bool =\
self._get_stored_tip_length_cal() is not None
if self._saved_offset_this_session:
Copy link
Member

Choose a reason for hiding this comment

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

only save the data if it's a legal transition

@codecov
Copy link

codecov bot commented Sep 28, 2020

Codecov Report

❗ No coverage uploaded for pull request base (edge@953d454). Click here to learn what that means.
The diff coverage is 77.84%.

Impacted file tree graph

@@           Coverage Diff           @@
##             edge    #6641   +/-   ##
=======================================
  Coverage        ?   89.03%           
=======================================
  Files           ?      101           
  Lines           ?     4505           
  Branches        ?        0           
=======================================
  Hits            ?     4011           
  Misses          ?      494           
  Partials        ?        0           
Impacted Files Coverage Δ
...t_server/robot/calibration/tip_length/constants.py 100.00% <ø> (ø)
...rver/robot/calibration/tip_length/state_machine.py 92.30% <ø> (ø)
...ver/robot_server/service/session/models/session.py 100.00% <ø> (ø)
...ession/session_types/pipette_offset_calibration.py 45.45% <33.33%> (ø)
...rver/robot/calibration/pipette_offset/user_flow.py 71.51% <60.25%> (ø)
.../robot/calibration/pipette_offset/state_machine.py 75.00% <85.71%> (ø)
...server/robot_server/robot/calibration/constants.py 97.43% <100.00%> (ø)
...ot-server/robot_server/robot/calibration/errors.py 100.00% <100.00%> (ø)
...rver/robot/calibration/pipette_offset/constants.py 97.05% <100.00%> (ø)
..._server/robot/calibration/pipette_offset/models.py 100.00% <100.00%> (ø)
... and 104 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 953d454...9f2a39d. Read the comment docs.


self._saved_offset_this_session = False
self._current_state = State.sessionStarted
self._state_machine = PipetteOffsetCalibrationStateMachine()
Copy link
Member

Choose a reason for hiding this comment

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

Let's try implementing loading one of two different state machines instead of doing checks in the handlers

@@ -44,12 +46,19 @@ const contentsBySessionType: { [SessionType]: { headerText: string } } = {
}

export function CompleteConfirmation(props: CalibrationPanelProps): React.Node {
Copy link
Member

Choose a reason for hiding this comment

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

If we add an intermediate complete state we can get rid of the bool

@b-cooper b-cooper requested a review from a team as a code owner October 5, 2020 19:33
TRASH_WELL = 'A1'
TRASH_REF_POINT_OFFSET = Point(-57.84, -55, 0) # offset from center of trash

CAL_BLOCK_SETUP_BY_MOUNT: Dict[Mount, Dict[str, str]] = {
Copy link
Member

Choose a reason for hiding this comment

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

Bit of a nit but the actual lef elements here (the dicts that contain load_name slot and wells should probably be a dataclass IMO

self._nozzle_height_at_reference: Optional[float] = None

self._load_tiprack(tip_rack_def)
self._has_calibrated_tip_length: bool =\
Copy link
Member

Choose a reason for hiding this comment

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

So this only happens if there is no stored tip length calibration for this pipette/tiprack combo, right?

I don't think that works with the labware-cal-initiated tip length _re_calibration. If you have a valid TLC that you want to redo, the only way for the system to accomplish that would be to DELETE it using the HTTP endpoint and then start this flow. But if you then decide to skip it, there's no more calibration.

Copy link
Member

Choose a reason for hiding this comment

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

Basically we may want a flag as a create param that is like "force tip length recalibration"

Copy link
Contributor

Choose a reason for hiding this comment

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

right that makes sense

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Happy with the code!

@sfoster1 sfoster1 requested a review from nusrat813 October 6, 2020 20:35
@@ -12,6 +12,14 @@ class SessionCreateParams(BaseModel):
...,
description='The mount on which the pipette is attached, left or right'
)
tipLengthLoad: bool = Field(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The name of this variable is a little confusing to me. Is it a boolean of "should Perform TLC prior to pipette offset cal"? If so, maybe something like shouldCalibrateTipLength would be clearer?

@Laura-Danielle Laura-Danielle merged commit 5819f29 into edge Oct 7, 2020
@Laura-Danielle Laura-Danielle deleted the robot-server_tlc-in-pip-offset-cal branch October 7, 2020 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Affects the `app` project hmg hardware, motion, and geometry robot server Affects the `robot-server` project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offset calibration: Implement tip rack selection in robot server
3 participants