- 
                Notifications
    You must be signed in to change notification settings 
- Fork 186
refactor(protocol-designer): call getMatchingTipLiquidSpecsFromSpec() with tiprackDef #19901
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
base: chore_release-pd-8.6.1
Are you sure you want to change the base?
Conversation
| Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@                   Coverage Diff                   @@
##           chore_release-pd-8.6.1   #19901   +/-   ##
=======================================================
  Coverage                   58.00%   58.00%           
=======================================================
  Files                        3413     3413           
  Lines                      283910   283906    -4     
  Branches                    39369    39369           
=======================================================
  Hits                       164671   164671           
+ Misses                     118966   118962    -4     
  Partials                      273      273           
 Flags with carried forward coverage won't be shown. Click here to find out more. 
 🚀 New features to boost your workflow:
 | 
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.
makes sense to me. I left a couple of comments regarding typing
| ?.byTipType.find(byTipType => byTipType.tiprack === tiprack) | ||
| // TODO: this won't find the definition for a custom tiprack | ||
| const tiprackDef = getAllDefinitions()[tiprack] | ||
| console.assert(tiprackDef, `could not find labware definition for ${tiprack}`) | 
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.
just to be a bit more explicit
| console.assert(tiprackDef, `could not find labware definition for ${tiprack}`) | |
| console.assert(tiprackDef != null, `could not find labware definition for ${tiprack}`) | 
| pipetteSpecs: PipetteV2Specs, | ||
| volume: number, | ||
| tiprackUri: string | ||
| tiprackDef: LabwareDefinition2 | 
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.
If I'm understanding this, I think this type should be a union including null
| tiprackDef: LabwareDefinition2 | |
| tiprackDef: LabwareDefinition2 | null | 
| .find(byPipette => byPipette.pipetteModel === pipetteName) | ||
| ?.byTipType.find(byTipType => byTipType.tiprack === tiprack) | ||
| // TODO: this won't find the definition for a custom tiprack | ||
| const tiprackDef = getAllDefinitions()[tiprack] | 
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.
for types to agree when passing this arg
| const tiprackDef = getAllDefinitions()[tiprack] | |
| const tiprackDef = getAllDefinitions()[tiprack] ?? null | 
Overview
Part 5 for tiprack definition lookups in PD.
Back in PR #19041, @ncdiehl11 introduced the function
getMatchingTipLiquidSpecsFromSpec()that takes a tiprack URI and tries to look up the tiprack definition. It sometimes fails, producing Sentry errors like:However, there is no need for
getMatchingTipLiquidSpecsFromSpec()itself to look up the tiprack definition, because the caller already has the tiprack definition.So this PR changes
getMatchingTipLiquidSpecsFromSpec()to take a tiprack labware definition instead of a tiprack URI.Note that the existing implementation in
load-file/migration/8_5_0.tsto find the tiprack definition is not quite correct, and would fail for custom tipracks. But we'll fix that in a future PR.Test Plan and Hands on Testing
CI tests.
Risk assessment
Low.