-
Notifications
You must be signed in to change notification settings - Fork 180
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(protocol-designer): load_trash_bin and load_waste_chute for Flex #17632
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## edge #17632 +/- ##
==========================================
+ Coverage 25.68% 25.71% +0.03%
==========================================
Files 2850 2850
Lines 219210 219387 +177
Branches 17955 18045 +90
==========================================
+ Hits 56300 56412 +112
- Misses 162895 162960 +65
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Thanks! Some small comments:
trashBin.location != null | ||
? formatPyStr(getCutoutDisplayName(trashBin.location as CutoutId)) | ||
: 'unknown trash location' // note: should never hit unknown trash location since location is always defined for trashBin entity | ||
return `${trashBin.pythonName} = ${PROTOCOL_CONTEXT_NAME}.load_trash_bin(location = ${location})` |
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.
Nit: close up the space around location =
. Python style guides don't put a space for named function call arguments.
getLoadTrashBins(additionalEquipmentEntities), | ||
getLoadWasteChute(additionalEquipmentEntities), | ||
] | ||
: []), |
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.
Could you move this above the load_liquid
block of code to group this with the other hardware-loading commands?
trashBin.location != null | ||
? formatPyStr(getCutoutDisplayName(trashBin.location as CutoutId)) | ||
: 'unknown trash location' // note: should never hit unknown trash location since location is always defined for trashBin entity | ||
return `${trashBin.pythonName} = ${PROTOCOL_CONTEXT_NAME}.load_trash_bin(location = ${location})` |
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.
Also, you can just take out the location =
altogether. The convention I've been following is, if the Python argument is mandatory and there's no ambiguity on what it means, leave out the argument name. If it's optional, then include the argument name. This makes the code a bit cleaner.
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.
oops yes, i forgot. i remember you mentioned this on a previous pr. sorry, will fix this!
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.
Cool. I tried it in a branch, and this looks good.
closes AUTH-1510
Overview
1st, this PR creates the
pythonName
for trash bins and waste chutes in the additional equipment entities when they're created fromcreate_deck_fixture
redux action and the reducer2nd, this PR emits
load_trash_bin
andload_waste_chute
for exporting python for Flex protocols (since OT-2 has fixed trash always available - see https://docs.opentrons.com/v2/new_protocol_api.html?highlight=waste#opentrons.protocol_api.ProtocolContext.fixed_trash)NOTE: this already supports multiple trash bins even though we do not support selecting multiple trash bins in the UI yet.
Test Plan and Hands on Testing
Test creating a trash bin and waste chute for a flex and observe the python protocol generated, should include the load commands for trash bin and waste chute. then test creating an ot-2 protocol and see that there is no trash bin command generated
Changelog
getLoadTrashBin
andgetLoadWasteChute
and wire up for flex protocols, generate based off of trash bin and waste chute entities createdRisk assessment
low, behind ff