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(step-generation): wire up moveLabware into waste chute #13950

Merged
merged 6 commits into from
Nov 14, 2023

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented Nov 8, 2023

closes RAUT-778

Overview

Wires up moveLabware into waste chute in step-generation and adds a bit of logic for labware listed in the dropdowns and adds an error creator for if there is no gripper.

Test Plan

Turn on the deck modification feature flag. Create a flex protocol and add a trash bin, a gripper and a waste chute.

In the deck setup, add a Move Labware step. select the tiprack to move and select the gripper checkbox. Select "Waste Chute in D3" for the new location. Create the step. See that nothing errors.

Now, go to the file setup (click on the file tab on the left) and delete the gripper. Go back to the deck setup and see that there is a timeline error saying that a gripper is required.

Go back to file setup and re-add the gripper and see that the timeline error is gone.

now export the protocol. Look at the json file and examine that the moveLabware command's newLocation says "addressableAreaName: gripperWasteChute"

Changelog

  • add addressableAreaName location logic to the protocol-designer & step-generation components
  • add logic for getLabwareLocation selector to filter out labware that is in the waste chute
  • add a new error creator for checking if gripper is required and plug into moveLabware
  • add test coverage

Review requests

see test plan

Risk assessment

low

Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Merging #13950 (27b1b74) into edge (882c75b) will increase coverage by 0.01%.
Report is 3 commits behind head on edge.
The diff coverage is 45.45%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #13950      +/-   ##
==========================================
+ Coverage   70.72%   70.73%   +0.01%     
==========================================
  Files        1628     2506     +878     
  Lines       54157    70765   +16608     
  Branches     3833     8710    +4877     
==========================================
+ Hits        38301    50055   +11754     
- Misses      15202    18586    +3384     
- Partials      654     2124    +1470     
Flag Coverage Δ
app 67.88% <ø> (+29.25%) ⬆️
protocol-designer 45.77% <45.45%> (+0.01%) ⬆️
shared-data 73.29% <ø> (ø)
step-generation 86.57% <ø> (-0.04%) ⬇️

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

Files Coverage Δ
protocol-designer/src/load-file/migration/8_0_0.ts 79.54% <ø> (ø)
...neration/src/commandCreators/atomic/moveLabware.ts 75.00% <ø> (-1.75%) ⬇️
step-generation/src/errorCreators.ts 92.30% <ø> (ø)
...src/getNextRobotStateAndWarnings/forMoveLabware.ts 0.00% <ø> (ø)
step-generation/src/types.ts 100.00% <ø> (ø)
protocol-designer/src/ui/labware/selectors.ts 72.97% <66.66%> (-5.82%) ⬇️
protocol-designer/src/steplist/fieldLevel/index.ts 36.36% <20.00%> (-2.10%) ⬇️

... and 880 files with indirect coverage changes

@jerader jerader force-pushed the pd_move-labware-waste-chute branch from 6b2dbf0 to 861e88a Compare November 9, 2023 17:36
)
) {
return {
addressableAreaName: 'gripperWasteChute',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the getLabwareLocation util that this is a part of is specifically for the newLocation field in moveLabware. That is why the addressableAreaName is always going to be gripperWasteChute, since you can't move labware with a pipette or move labware into a trash bin.

@jerader jerader marked this pull request as ready for review November 9, 2023 18:06
@jerader jerader requested a review from a team as a code owner November 9, 2023 18:06
@jerader jerader requested a review from a team November 9, 2023 18:06
@jerader jerader requested a review from a team as a code owner November 9, 2023 18:06
@jerader jerader requested review from ncdiehl11 and removed request for a team November 9, 2023 18:06
@jerader jerader force-pushed the pd_move-labware-waste-chute branch from f9a404a to f8bfebd Compare November 13, 2023 20:20
@jerader jerader requested review from shlokamin and removed request for a team November 13, 2023 20:39
Copy link
Member

@shlokamin shlokamin 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 to me! just left a naming nit (which i think is important thing to clear up since all of the new deck config lingo is confusing as it is)

Comment on lines 90 to 92
getIsAddressableAreaLocation(
newLocationString,
state.additionalEquipmentEntities
Copy link
Member

Choose a reason for hiding this comment

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

getIsAddressableAreaLocation isnt just checking if this is an addressable area (a generic rectangular plane), its specifically checking if the labware is an "additional equipment entity" right? it looks like an AdditionalEquipmentEntity is typed to only be a 'gripper' | 'wasteChute' | 'stagingArea'

just wanna make sure we're using the terminology consistently cc @brenthagen

Copy link
Collaborator Author

@jerader jerader Nov 13, 2023

Choose a reason for hiding this comment

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

So the only time the moveLabware's new location is going to be an addressableAreaName is if its moving labware into the waste chute, right? Because you can only move labware into a slot, an adapter, on top of a module, off deck, and into a waste chute.

Maybe I should rename the util to getIsWasteChuteLocation. the additionalEquipmentEntities type is AdditionalEquipmentEntities but should technically be something more specific for only waste chute.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

does that make sense? cc @brenthagen @shlokamin

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're only checking to see if the labware is being moved into the waste chute then yeah lets rename the function to be that specfic.

more broadly though, maybe this is pointing to an interface issue with AdditionalEquipmentEntity, which can be a gripper, waste chute, or staging area. it reasonable to think that you can move labware into a staging area (which has a location), but what does it mean to move a labware into a gripper? what is the gripper's location?

export interface NormalizedAdditionalEquipmentById {
  [additionalEquipmentId: string]: {
    name: 'gripper' | 'wasteChute' | 'stagingArea'
    id: string
    location?: string
  }
}

@jerader jerader merged commit e401da0 into edge Nov 14, 2023
31 of 32 checks passed
@jerader jerader deleted the pd_move-labware-waste-chute branch November 14, 2023 13:23
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.

2 participants