-
Notifications
You must be signed in to change notification settings - Fork 179
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): add designerApplication labware, pipettes, m… #17432
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## edge #17432 +/- ##
==========================================
+ Coverage 18.15% 18.19% +0.03%
==========================================
Files 3173 3174 +1
Lines 229557 229629 +72
Branches 6889 6908 +19
==========================================
+ Hits 41682 41781 +99
+ Misses 187875 187848 -27
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -268,7 +247,7 @@ export const createFile: Selector<ProtocolFile> = createSelector( | |||
commandAnnotations, | |||
} | |||
|
|||
const protocolBase: ProtocolBase<DesignerApplicationDataV8_5> = { | |||
const protocolBase: ProtocolBase<PDMetadata> = { |
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.
realized that PDMetadata
is the proper type to use here - we had several designerApplicationData
types floating around.
// NOTE: PD currently supports saving both v3 and v4, depending on whether it has modules | ||
export type PDProtocolFile = | ||
| ProtocolFileV3<PDMetadata> | ||
| ProtocolFileV4<PDMetadata> | ||
| ProtocolFileV5<PDMetadata> | ||
| ProtocolFileV6<PDMetadata> |
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.
this was significantly outdated... still referenced protocol schema v6
facc82c
to
a66ed78
Compare
"dispense_mmFromBottom": 1, | ||
"touchTip_mmFromTop": -1, | ||
"blowout_mmFromTop": 0 | ||
}, |
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.
Yay!
) | ||
} | ||
const id = labwareId ?? 'unknown id' | ||
const displayName = labwareDefinitions[labwareDefURI].metadata.displayName |
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.
Is the if (labwareDefinitions[labwareDefURI] == null)
supposed to guard against something? Wouldn't this line of code still crash if labwareDefinitions[labwareDefURI]
is in fact null?
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.
i guess its to help debug. it shouldn't be null, but if it is, we can see the console errors and know how to fix it faster 😄
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.
Oh, I mean like: if you expect the code not to be runnable if labwareDefinitions[labwareDefURI] == null
, wouldn't it be better to just throw an exception rather than console.error
and letting the code continue to run?
In the #protocol-designer channel, we often get user reports like "An unknown error has occurred. Contact support with the following message: Cannot read properties of undefined." Our users don't have the Chrome Inspector open, so they won't see any messages in console.log
, right? If you throw the error message as an exception, at least we'll get better error reports from users :)
|
||
return { | ||
...acc, | ||
[id]: { |
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.
Hm, just in case labwareId
is null, would it be better to pick an id
that's more unique than 'unknown id'
, so that all the missing labwareId
s don't get smushed together into the same entry here?
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.
so, according to load_labware.py
, labwareId
is optional. However, PD will always populate labwareId
in the loadLabware
JSON commands. We shouldn't run into a case where this is null ever unless the user corrupted their protocol.
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.
but similarly to the above comment about labwareDefURI
being null in labwareDefinitions
, i added a console.error
to help debug in the event that labwareId
is null.
#17432) …odules keys closes AUTH-1407 This PR introduces `designerApplication` top level keys for `modules`, `labware`, and `pipettes`. Then when you import a protocol, the migration will grab that info from the load commands and the `load-file` reducer will use that info to populate the `labwareEntities`, `pipetteEntities`, and `moduleEntities`. Additionally, this pr deprecates the `defaultValues` key that was not in use at all
…odules keys
closes AUTH-1407
Overview
This PR introduces
designerApplication
top level keys formodules
,labware
, andpipettes
. So exporting a JSON protocol should look like this:then when you import a protocol, the migration will grab that info from the load commands and the
load-file
reducer will use that info to populate thelabwareEntities
,pipetteEntities
, andmoduleEntities
.Additionally, this pr deprecates the
defaultValues
key that was not in use at allTest Plan and Hands on Testing
Create a protocol and export it. the JSON file should include these new keys
upload an old protocol and see that it migrates correctly
Changelog
designerApplication
type8_5_0
migration, fix up theload-file
reducer to grab this new informationRisk assessment
med-ish,