-
Notifications
You must be signed in to change notification settings - Fork 187
feat(protocol-designer, step-generation): Generate hopper full error on fill and store stacker steps #20329
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
base: edge
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## edge #20329 +/- ##
==========================================
- Coverage 25.58% 25.08% -0.51%
==========================================
Files 3636 3635 -1
Lines 302933 302887 -46
Branches 42346 42423 +77
==========================================
- Hits 77520 75972 -1548
- Misses 225389 226887 +1498
- Partials 24 28 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
|
||
| export const flexStackerHopperFull = (): CommandCreatorError => { | ||
| return { | ||
| type: 'HOPPER_FULL', |
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.
can you add this to the i18n file as well? I think it is alert.json
| ...(count != null ? [`count=${count}`] : []), | ||
| ...(message != null ? [`message=${formatPyStr(message)}`] : []), | ||
| ] | ||
| // TODO: add mismatched labware error ? |
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.
oh ya we probably do want the mismatch labware error in here too!
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.
done!
…for mismatched labware and description for full hopper
step-generation/src/utils/misc.ts
Outdated
| const maximumAllowedLabware = stackerState?.maxPoolCount ?? 0 | ||
| const labwareStored = stackerState?.labwareInHopper | ||
| const numberOfLabwareStored = labwareStored?.length ?? 0 | ||
| return numberOfLabwareStored + 1 < maximumAllowedLabware |
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 think we don't need this +1. We're checking if there is space in the hopper at all at this point. With the +1, you could add 1 too many labwares, right?
| return numberOfLabwareStored + 1 < maximumAllowedLabware | |
| return numberOfLabwareStored < maximumAllowedLabware |
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.
oh yes you are right over thought this one!
| if (labwareToStore) { | ||
| for (const labware of labwareToStore) { | ||
| if ( | ||
| labwareMatchesLabwareInHopper( | ||
| labware.primaryLabwareId, | ||
| invariantContext, | ||
| flexStackerState | ||
| ) | ||
| ) { | ||
| continue | ||
| } else { | ||
| return { | ||
| errors: [errorCreators.flexStackerLabwareTypeMismatch()], | ||
| } | ||
| } | ||
| } | ||
| } |
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 way totally works! but it is a bit cleaner, imo, to use .every()
| if (labwareToStore) { | |
| for (const labware of labwareToStore) { | |
| if ( | |
| labwareMatchesLabwareInHopper( | |
| labware.primaryLabwareId, | |
| invariantContext, | |
| flexStackerState | |
| ) | |
| ) { | |
| continue | |
| } else { | |
| return { | |
| errors: [errorCreators.flexStackerLabwareTypeMismatch()], | |
| } | |
| } | |
| } | |
| } | |
| if (labwareToStore) { | |
| const allMatch = labwareToStore.every(labware => | |
| labwareMatchesLabwareInHopper( | |
| labware.primaryLabwareId, | |
| invariantContext, | |
| flexStackerState | |
| ) | |
| ) | |
| if (!allMatch) { | |
| return { | |
| errors: [errorCreators.flexStackerLabwareTypeMismatch()], | |
| } | |
| } | |
| } |
jerader
left a comment
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.
nice job! just left a few minor comments
Overview
Generate hopper full error on fill and store steps
Test Plan and Hands on Testing
Changelog
Risk assessment
low
Partially closes EXEC-1448