fix(protocol-designer, shared-data, step-generation): always nick name top non-lid labware in a stack#21024
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## edge #21024 +/- ##
==========================================
- Coverage 56.69% 56.28% -0.42%
==========================================
Files 3967 3971 +4
Lines 328377 328890 +513
Branches 46499 46630 +131
==========================================
- Hits 186187 185112 -1075
- Misses 141970 143560 +1590
+ Partials 220 218 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| }, | ||
| }) | ||
| const topLabwareId = labwareIds[0] | ||
| const stackOnlyHasLids = |
There was a problem hiding this comment.
this can probably move to a utils?
step-generation/src/utils/misc.ts
Outdated
| lw.stack.includes(HOPPER_STACKER_LOCATION) === isOnHopper | ||
| ) | ||
| .sort((a, b) => b.stack.length - a.stack.length)[0]?.stack ?? [] | ||
| .sort((a, b) => a.stack.length - b.stack.length) |
There was a problem hiding this comment.
will this change not affect other places that use this method?
| const labwareStack = Object.values(labware).filter( | ||
| lw => | ||
| lw.stack.includes(mappedLocation) && | ||
| (offDeckOverrideId == null || lw.stack.includes(offDeckOverrideId)) && | ||
| lw.stack.includes(HOPPER_STACKER_LOCATION) === isOnHopper | ||
| ) | ||
| const index = returnLargestStack ? -1 : 0 | ||
| return ( | ||
| Object.values(labware) | ||
| .filter( | ||
| lw => | ||
| lw.stack.includes(mappedLocation) && | ||
| (offDeckOverrideId == null || lw.stack.includes(offDeckOverrideId)) && | ||
| lw.stack.includes(HOPPER_STACKER_LOCATION) === isOnHopper | ||
| labwareStack | ||
| .sort( | ||
| returnLargestStack | ||
| ? (a, b) => a.stack.length - b.stack.length | ||
| : (a, b) => b.stack.length - a.stack.length | ||
| ) | ||
| .sort((a, b) => b.stack.length - a.stack.length)[0]?.stack ?? [] | ||
| .at(index)?.stack ?? [] |
There was a problem hiding this comment.
Can you give some color on why this change is needed?
| const allLabwareNotLids = getAllLabwareWithoutLids(deckSetup) | ||
| const topLabwareThatIsNotALid = deckSetupLabware[allLabwareNotLids[0]] |
There was a problem hiding this comment.
sorry if I'm not following, but doesn't allLabwareNotLids return all labware across the deck without a lid? And topLabwareThatIsNotALid will arbitrarily pick the first one of those un-lidded labwares?
Overview
Prevent nicknaming of lids and always nick names the top most non-lid labware in a stack
Test Plan and Hands on Testing
lid smoke test.py
lid.bug.testing.mov
Changelog
EditNickNameModalgetFullStackFromLabwaresto return the largest stack at the end of the list of stacks to ensure the top labware in a stacker is what gets renamed.Review requests
getFullStackFromLabwaresutil or is this fine since all unit tests pass?Risk assessment
Closes AUTH-2770