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

fix(protocol-designer): auto-generate trashBin for flex if no pipetting commands exist #14857

Merged
merged 5 commits into from
Apr 11, 2024

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented Apr 10, 2024

closes AUTH-267

Overview

In PD in production, if you create a Flex protocol with no pipetting steps and reupload it to the app, it does not auto generate a trash bin for you. Technically there is a way around it by adding a trash bin entity. But its a weird state because return tip and no trash entity is not supported in PD.

Ot-2 does not have this issue because it always ensures a hardcoded fixed trash is generated

So this PR auto-generates a trash bin for a flex if there is none when importing a protocol.

Test Plan

I created a test case to test all scenarios, so it should work as expected.

However, you can create a flex protocol and add a pause step. Download the protocol and reimport it back to PD. See that the trash bin is generated.

Changelog

  • create util for getting an unoccupied slot, taking into account modules, labwares, move labware commands, waste chute, and staging area slots
  • add test

Review requests

see test plan

Risk assessment

low

@jerader jerader requested a review from a team as a code owner April 10, 2024 15:56
@jerader jerader requested review from koji and ncdiehl11 and removed request for a team April 10, 2024 15:57
Comment on lines -244 to -250
if (
!cutouts.includes(FLEX_TRASH_DEFAULT_SLOT) &&
!moduleSlots.includes('A3')
) {
return FLEX_TRASH_DEFAULT_SLOT
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

now unnecessary logic since we are listing 'A3' as the first cutout in the array to map through

@koji
Copy link
Contributor

koji commented Apr 10, 2024

question

when I added waste chute, export and import the protocol into pd, trash bin is generated but waste chute is gone.
Is this expected behavior?

@jerader
Copy link
Collaborator Author

jerader commented Apr 10, 2024

question

when I added waste chute, export and import the protocol, trash bin is generated but waste chute is gone. Is this expected behavior?

@koji oops that is definitely a bug! Thanks for catching it.

@jerader
Copy link
Collaborator Author

jerader commented Apr 10, 2024

question
when I added waste chute, export and import the protocol, trash bin is generated but waste chute is gone. Is this expected behavior?

@koji oops that is definitely a bug! Thanks for catching it.

@koji actually, if you did not add any waste chute commands, it is not a bug since we remove any staging area slot and waste chute that is not used in the protocol. But if you did add waste chute commands, it is a bug.

@koji
Copy link
Contributor

koji commented Apr 10, 2024

question
when I added waste chute, export and import the protocol, trash bin is generated but waste chute is gone. Is this expected behavior?

@koji oops that is definitely a bug! Thanks for catching it.

@koji actually, if you did not add any waste chute commands, it is not a bug since we remove any staging area slot and waste chute that is not used in the protocol. But if you did add waste chute commands, it is a bug.

@jerader I added waste chute from the initial setup wizard.

@koji
Copy link
Contributor

koji commented Apr 10, 2024

one more question

I compared two json.
left: exported json - no trash bin
right: import the left json and re-export (trash bin with auto generated)

making pipetteTiprackAssignments item nested (adding []) is an expected behavior?

Screenshot 2024-04-10 at 1 57 51 PM

left
no-trashbin.json

right
no-trashbin (1).json

@jerader
Copy link
Collaborator Author

jerader commented Apr 11, 2024

one more question

I compared two json. left: exported json - no trash bin right: import the left json and re-export (trash bin with auto generated)

making pipetteTiprackAssignments item nested (adding []) is an expected behavior?

left no-trashbin.json

right no-trashbin (1).json

@koji oh i think what's happening is when you reimport, it goes through the 8.1 migration because the version when you export is 8.0.3 and not 8.1.0 - this is a current limitation with PD where the versioning doesn't update until i push a release tag 😦 so for now we have to manually change the version before we reimport.

This is a great catch though! i forgot that we have to do this.

@jerader
Copy link
Collaborator Author

jerader commented Apr 11, 2024

question
when I added waste chute, export and import the protocol, trash bin is generated but waste chute is gone. Is this expected behavior?

@koji oops that is definitely a bug! Thanks for catching it.

@koji actually, if you did not add any waste chute commands, it is not a bug since we remove any staging area slot and waste chute that is not used in the protocol. But if you did add waste chute commands, it is a bug.

@jerader I added waste chute from the initial setup wizard.

@koji got it, this sounds like expected behavior. if you didn't add any step using the waste chute then it isn't being used in the protocol and won't generate upon reimport or even if you upload it to the app.

@jerader jerader requested a review from koji April 11, 2024 16:01
Copy link
Contributor

@koji koji left a comment

Choose a reason for hiding this comment

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

thank you for answering to all my questions.
LGTM!

@jerader jerader merged commit 332355e into edge Apr 11, 2024
14 checks passed
@jerader jerader deleted the pd_fix-trash-bin-auto-generating branch April 11, 2024 16:09
Carlos-fernandez pushed a commit that referenced this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants