-
Notifications
You must be signed in to change notification settings - Fork 178
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(app, api): calibration check middleware #6781
refactor(app, api): calibration check middleware #6781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome! 🔑
@@ -58,7 +65,13 @@ export function TipConfirmation(props: CalibrationPanelProps): React.Node { | |||
sendCommands({ command: moveCommandString }) | |||
} | |||
|
|||
return ( | |||
const isBadTipPickUp = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move this cal check specific step/panel combination into it's own file in the CheckCalibration component directory. That way these generic panels don't have to serve every special case. This example is branching only on currentStep (within a check cal session), which is exactly what the parent component step/panel mapping does, it should just slot in there.
|
||
const ROBOT_CALIBRATION_CHECK_SUBTITLE = 'Robot calibration heatlh check' | ||
const ROBOT_CALIBRATION_CHECK_SUBTITLE = 'Calibration heatlh check' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ROBOT_CALIBRATION_CHECK_SUBTITLE = 'Calibration heatlh check' | |
const ROBOT_CALIBRATION_CHECK_SUBTITLE = 'Calibration health check' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of little change requests to keep in mind
|
||
if (moveCommandString) { | ||
commands = [...commands, { command: moveCommandString }] | ||
let commands = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the stuff in 190:196 only apply to isHealthCheck === true
? if so consider moving it into the if block on 185:187. Also consider making this a const
-binding using an anonymous function or a logical expression like a ternary, eg
const commands = isHealthCheck
?( (finalCommand && activePipette?.rank
? ...
: ...)
: ...)
@@ -26,9 +26,9 @@ import { CalibrationLabwareRender } from './CalibrationLabwareRender' | |||
import styles from './styles.css' | |||
|
|||
const DECK_SETUP_WITH_BLOCK_PROMPT = | |||
'Place full tip rack and Calibration Block on the deck within their designated slots as illustrated below.' | |||
'Place full tip rack(s) and Calibration Block on the deck within their designated slots as illustrated below.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a little thing, but in all flows except cal check this will never have multiple tip racks. consider either making separate values or making this a function that accepts the number of tipracks or something.
{ command: Sessions.sharedCalCommands.MOVE_TO_POINT_ONE } | ||
) | ||
let continueCommands | ||
if (sessionType === Sessions.SESSION_TYPE_CALIBRATION_HEALTH_CHECK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using const
-binding here with a ternary or something.
@@ -16,4 +18,8 @@ export type CalibrationPanelProps = {| | |||
sessionType: SessionType, | |||
calBlock?: CalibrationLabware | null, | |||
shouldPerformTipLength?: boolean | null, | |||
checkBothPipettes?: boolean | null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is growing a whole lot of optional attributes. While we don't have to do it now, we should at the very least drop a todo to refactor this into a union type discriminated on the session type.
const comparison = comparisonsByStep[step] | ||
if (comparison && comparison.exceedsThreshold) { | ||
return comparison | ||
].reduce((acc, step): CalibrationHealthCheckComparison | null => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We needed this last-failed logic in the old system because of the overlapping of the calibration components; I don't think we need it anymore. Honestly since we're already going to have the marked-bad logic on the server side, it might be worth having the server just tell us which calibrations are a problem, and generating the troubleshooting screen based on that. In the interim, I think we definitely don't need this logic here.
@@ -20,7 +20,8 @@ class SessionCreateParams(BaseModel): | |||
) | |||
tipRackDefinition: Optional[dict] = Field( | |||
None, | |||
description='The full labware definition of the tip rack to calibrate.' | |||
description='The full tiprack definition(s)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is definitely set up to be a single tip rack definition, if we want it to be possibly-multiple we should probably make the type List[dict]
and change the session creators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change the description back. Basically was having a lot of issues w/ pydantic models -- I wanted to have an optional create param for check calibration but it was mixing up deck cal w/ check cal when I didn't specify the tipracks I wanted to use. Then I thought about adding it to this model, but realized it just wasn't worth it at this point.
@@ -120,6 +121,10 @@ def __init__(self, | |||
def hardware(self) -> ThreadManager: | |||
return self._hardware | |||
|
|||
@property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good change but does it belong in this pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the change before your other PR that was put up. I'm going to be rebasing anyways so I'll probably just remove this to make it easier.
@@ -80,7 +80,8 @@ async def delete_session_handler( | |||
session_obj = get_session(manager=session_manager, | |||
session_id=sessionId, | |||
api_router=router) | |||
|
|||
log.info("delete was called! ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember to remove/lower level
@@ -80,7 +80,8 @@ async def delete_session_handler( | |||
session_obj = get_session(manager=session_manager, | |||
session_id=sessionId, | |||
api_router=router) | |||
|
|||
log.info("delete was called! ") | |||
log.info(f"session object {session_obj}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember to remove/lower level
|
||
@classmethod | ||
async def create(cls, | ||
configuration: SessionConfiguration, | ||
instance_meta: SessionMetaData) -> BaseSession: | ||
"""Create an instance""" | ||
# (lc, 10-19-2020) For now, only pass in empty tipracks. We cannot | ||
# have a session model with an optional tiprack for session | ||
# create params right now because of the pydantic union problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than having it be optional, having it be a list that therefore may be empty is probably a good choice
8f225c6
to
91f20e5
Compare
Codecov Report
@@ Coverage Diff @@
## chore_release-4.0.0-beta.0 #6781 +/- ##
=============================================================
Coverage ? 87.53%
=============================================================
Files ? 101
Lines ? 4411
Branches ? 0
=============================================================
Hits ? 3861
Misses ? 550
Partials ? 0 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code all looks good to me, will test some
# off after | ||
session_controls_lights =\ | ||
not configuration.hardware.get_lights()['rails'] | ||
# await configuration.hardware.cache_instruments() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops!
fc44bcb
to
d958f33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
When the user selects and saves the trash surface as their tip length calibration target, send an event to intercom so that support can follow up about fulfilling a calibration block. This also brings back the intercom event epics and bindings removed in #6781, without the calibration check session end bindings.
When the user selects and saves the trash surface as their tip length calibration target, send an event to intercom so that support can follow up about fulfilling a calibration block. This also brings back the intercom event epics and bindings removed in #6781, without the calibration check session end bindings.
Overview
This PR ports calibration check over to the new architecture style/design of the other calibration flows. It also changes the name from
Robot Calibration Check
->Robot Calibration Health Check
. Closes #6725 and closes #6710.Changelog
robot calibration check
->calibration health check
Limitations and/or TODOs
Review requests
Please test on a robot, and let me know if there are other places I should throw TODOs in. I think at this point the PR should just be merged and all remaining work delegated to other tickets.
Risk assessment
High. This is completely changing how the calibration check session worked previously, although we are not releasing immediately, we should be weary of any new bugs that might get introduced.