Skip to content

feature(app): get command text for flex stacker commands #18045

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

Open
wants to merge 22 commits into
base: edge
Choose a base branch
from

Conversation

TamarZanzouri
Copy link
Contributor

@TamarZanzouri TamarZanzouri commented Apr 11, 2025

Overview

closes https://opentrons.atlassian.net/browse/EXEC-1135.
add flex stacker commands to command text

Test Plan and Hands on Testing

upload the following protocol and make sure all commands appear with the correct text:

requirements = {"robotType": "Flex", "apiLevel": "2.23"}


def run(protocol):
    stacker_c = protocol.load_module("flexStackerModuleV1", "C4")
    stacker_d = protocol.load_module("flexStackerModuleV1", "D4")
    stacker_c.set_stored_labware(load_name="opentrons_flex_96_tiprack_1000ul", count=5)

    tiprack = stacker_c.retrieve()
    stacker_c.store()
    stacker_c.empty(message="hell")
    stacker_c.fill(message="whatttt")

Changelog

added command text logic for flex stacker commands and added tests.
Screenshot 2025-04-15 at 9 29 30 PM

Review requests

changes make sesense? am I missing something?

Risk assessment

Medium. affects command text rendering, need to smoke test

@TamarZanzouri TamarZanzouri requested a review from a team as a code owner April 11, 2025 16:03
@TamarZanzouri TamarZanzouri requested review from ncdiehl11, mjhuff and smb2268 and removed request for a team and ncdiehl11 April 11, 2025 16:03
Copy link

codecov bot commented Apr 11, 2025

Codecov Report

Attention: Patch coverage is 54.59770% with 79 lines in your changes missing coverage. Please review.

Project coverage is 26.47%. Comparing base (b6a86c7) to head (9c7c4f3).

Files with missing lines Patch % Lines
...ing/utils/commandText/getFlexStackerCommandText.ts 64.28% 45 Missing ⚠️
...rganisms/CommandText/useCommandTextString/index.ts 0.00% 13 Missing ⚠️
.../useCommandTextString/utils/getLabwareLocation.tsx 0.00% 11 Missing ⚠️
...mandTextString/utils/getLabwareDisplayLocation.tsx 56.52% 10 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #18045      +/-   ##
==========================================
+ Coverage   25.47%   26.47%   +0.99%     
==========================================
  Files        3008     2966      -42     
  Lines      233870   231261    -2609     
  Branches    20072    19883     -189     
==========================================
+ Hits        59584    61221    +1637     
+ Misses     174271   170018    -4253     
- Partials       15       22       +7     
Flag Coverage Δ
step-generation 4.38% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...xt/useCommandTextString/utils/commandText/index.ts 100.00% <100.00%> (ø)
...mandTextString/utils/getLabwareDisplayLocation.tsx 65.78% <56.52%> (-3.52%) ⬇️
.../useCommandTextString/utils/getLabwareLocation.tsx 29.85% <0.00%> (+0.31%) ⬆️
...rganisms/CommandText/useCommandTextString/index.ts 77.20% <0.00%> (-4.32%) ⬇️
...ing/utils/commandText/getFlexStackerCommandText.ts 66.16% <64.28%> (+53.66%) ⬆️

... and 210 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

Lookin good. A couple clean up comments.

@TamarZanzouri TamarZanzouri requested a review from mjhuff April 11, 2025 18:03
Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

lgtm with passing CI!

Copy link
Contributor

@ecormany ecormany left a comment

Choose a reason for hiding this comment

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

Just nitpicking some prepositions. Can you tell I used to teach freshman composition? 😇

@TamarZanzouri TamarZanzouri requested a review from a team as a code owner April 11, 2025 20:13
@vegano1
Copy link
Contributor

vegano1 commented Apr 14, 2025

@TamarZanzouri
looks great, thank you
Can we also say the number of labware we are filling the stacker with for the' fill' command?

command: FlexStackerCommand
): string | null => {
if (command.result !== undefined && 'primaryLabwareURI' in command?.result) {
const currentLabwareDef = getAllLabwareDefs()[
Copy link
Contributor

@smb2268 smb2268 Apr 14, 2025

Choose a reason for hiding this comment

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

This should be refactored to grab the definitions from getLabwareDefinitionsByURIForProtocol which I added because we aren't able to get definitions for custom labware in this way. You'll might need to grab this definition map at the top level of command text and drill it down here!

"flex_stacker_fill": "Fill Flex Stacker",
"flex_stacker_fill_with_quantity_and_labware": "Fill Flex Stacker with {{quantity}} {{primaryDefinitionDisplayName}}",
"flex_stacker_retrieve": "Retrieve from Flex Stacker",
"flex_stacker_set_stored_labware": "Set stored labware in Flex Stacker",
Copy link
Contributor

Choose a reason for hiding this comment

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

These strings don't match the ones Nick and I came up with that are listed in the ticket. Can you update them to ensure they're all written properly? I also don't think we should need a version with + without all of these variables. Only setStoredLabware and fill should have optional fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are the strings from the ticket, I just made sure + default in case there is no command found

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a few small differences! Added a few more comments. Is it possible for there to be no command found here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smb2268 probably not.. I just followed the other module commands. if there are small diffs that might be bc Ed gave me feedback?

return ''
const primaryDefinitionDisplayName = getPrimaryLabwareUriIfExsists(command)
if (command.commandType === 'flexStacker/retrieve') {
const slotName = getLabwareDisplayLocation({
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll need to adjust this getLabwareDisplayLocation function for stacker. If we're trying to get the location of the stacker itself, we want to represent that as "Column A". For labware in the hopper it would be "Flex Stacker in Column A" and for the location shuttle location, we'll say "A4".

Copy link
Contributor

@smb2268 smb2268 left a comment

Choose a reason for hiding this comment

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

This looks good so far, but there's a little more work to do to get these strings and display locations in line with the product requirements - see above comments!

@@ -74,6 +82,7 @@
"prepare_to_aspirate": "Preparing {{pipette}} to aspirate",
"pressurizing_to_dispense": "Pressurize pipette to dispense {{volume}} µL from resin tip at {{flow_rate}} µL/sec",
"reloading_labware": "Reloading {{labware}}",
"retrieve_labware_from_stacker_to": "Retrieve {{primaryDefinitionDisplayName}} from {{slotName}}",
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have two locations -- from Flex Stacker in {{stackerColumn}} to {{slotName}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no "to" when retrieving. it stays on the shuttle

@TamarZanzouri TamarZanzouri requested a review from smb2268 April 16, 2025 14:52
Comment on lines +85 to +94
"flex_stacker_empty": "Manually empty all labware from Robot Stacker",
"flex_stacker_empty_from_location": "Manually empty all labware from Robot {{stackerColumn}}",
"flex_stacker_fill": "Fill Robot Stacker",
"flex_stacker_fill_with_quantity_and_labware": "Fill Robot {{stackerColumn}} with {{quantity}} {{labwareAndLidDisplayNames}}",
"flex_stacker_retrieve": "Retrieve from Robot Stacker",
"flex_stacker_set_stored_labware": "Set stored labware in Robot Stacker",
"flex_stacker_set_stored_labware_with_quantity_and_location": "Configure Robot {{stackerColumn}} with {{quantity}} {{labwareAndLidDisplayNames}}",
"flex_stacker_store": "Store into Robot Stacker",
"store_labware_from_slot_to_stacker": "Store {{primaryDefinitionDisplayName}} from {{slotName}} to Robot Stacker",
"retrieve_labware_from_stacker_to": "Retrieve {{primaryDefinitionDisplayName}} from Robot Stacker to {{slotName}}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it intentional to treat "Robot Stacker" as a proper noun?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nick asked to switch Flex Stacker with Robot Stacker :-) let me know what you think it should be instead

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.

5 participants