Skip to content

feat(protocol-designer, step-generation): add logic to getTransferPlanAndReferenceVolumes #18666

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

Merged

Conversation

ncdiehl11
Copy link
Collaborator

@ncdiehl11 ncdiehl11 commented Jun 17, 2025

Overview

Updates step-generation util getTransferPlanAndReferenceVolumes to return most accurate reference volumes for aspirate and dispense properties.

Context

The util getTransferPlanAndReferenceVolumes in step-generation takes various parameters of a PD transfer, including number of sources/destinations, path, volume, pipette, tiprack, and liquid class, and returns a calculated transfer plan for the parameters, as well the reference volumes on which to interpolate various by-volume properties for the liquid class— in other words, the x-values to lookup on the liquid class definition's by-volume curves.

Some of these volumes are straightforward. For example, in a transfer with a single path (n wells-to-n wells), we interpolate all by-volume properties (post-aspirate air gap, flow rate, correction volumes) based on the transfer volume, or split transfer volume if the full volume cannot be accommodated in the tip.

However, the volume on which to interpolate is not as straightforward to represent as a constant number in other scenarios. For example, post-dispense air gap should be interpolated based on the volume of liquid in the tip at the time of the air gap. If we specify a multi-dispense path, it becomes apparent that the volume on which to interpolate varies from well to well— that is, the volume in the tip after the first dispense is higher than that after the second dispense, and so on.

In order to respect the constant air gap value entered by the user in the PD step form for post-dispense air gap in this case, we cannot find the correct interpolated post-dispense air gap value after each dispense "behind the scenes." To provide an accurate option for the user to start with, we have settled as a team on presenting the interpolated by-volume post-dispense air gap for multi-dispense transfers interpolated on the volume remaining in the tip after the first dispense. Similarly, for post-aspirate air gap in multi-aspirate transfers, we will present the value interpolated on the planned maximum total aspiration volume for the largest "chunk" of aspirations.

As part of this update, I break some of the reference volume keys into objects with aspirate and dispense property reference volumes for clarity, and wire them up appropriately in our handleFormChange utils.

Changelog

  • update getTransferPlanAndReferenceVolumes according to description above
  • correctly access nested reference volume properties in FlowRateField and PD handleFormChange utils
  • update tests

Review requests

Please read through the description and check out the refactored getTransferPlanAndReferenceVolumes util to make sure it makes sense.

Risk assessment

low-medium. These changes should only serve to make our presented by-volume interpolated constant values more accurate in PD step forms

…nAndReferenceVolumes

Updates step-generation util `getTransferPlanAndReferenceVolumes` to return a separate reference volume for post-dispense air gap.
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 88.52459% with 7 lines in your changes missing coverage. Please review.

Project coverage is 24.05%. Comparing base (b19784c) to head (0bff133).
Report is 3 commits behind head on chore_release-pd-8.5.0.

Files with missing lines Patch % Lines
...ocolSteps/StepForm/PipetteFields/FlowRateField.tsx 0.00% 4 Missing ⚠️
...r/src/steplist/formLevel/handleFormChange/utils.ts 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                     @@
##           chore_release-pd-8.5.0   #18666      +/-   ##
==========================================================
- Coverage                   24.12%   24.05%   -0.07%     
==========================================================
  Files                        3282     3256      -26     
  Lines                      285236   281550    -3686     
  Branches                    28696    28565     -131     
==========================================================
- Hits                        68808    67726    -1082     
+ Misses                     216403   213799    -2604     
  Partials                       25       25              
Flag Coverage Δ
protocol-designer 19.12% <49.18%> (-0.13%) ⬇️
step-generation 5.19% <88.52%> (-0.06%) ⬇️

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

Files with missing lines Coverage Δ
step-generation/src/utils/misc.ts 66.31% <100.00%> (+0.86%) ⬆️
...r/src/steplist/formLevel/handleFormChange/utils.ts 16.11% <0.00%> (ø)
...ocolSteps/StepForm/PipetteFields/FlowRateField.tsx 1.05% <0.00%> (ø)

... and 136 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.

@ncdiehl11 ncdiehl11 changed the title feat(protocol-designer,-step-generation): add logic to getTransferPlanAndReferenceVolumes feat(protocol-designer, step-generation): add logic to getTransferPlanAndReferenceVolumes Jun 17, 2025
@ncdiehl11 ncdiehl11 self-assigned this Jun 18, 2025
@ncdiehl11 ncdiehl11 requested review from ddcc4 and jerader June 18, 2025 00:41
@ncdiehl11 ncdiehl11 marked this pull request as ready for review June 18, 2025 00:41
@ncdiehl11 ncdiehl11 requested a review from a team as a code owner June 18, 2025 00:41
@ncdiehl11 ncdiehl11 removed the request for review from a team June 18, 2025 00:41
Copy link
Collaborator

@jerader jerader left a comment

Choose a reason for hiding this comment

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

i think this makes sense

@ncdiehl11 ncdiehl11 merged commit 22cec22 into chore_release-pd-8.5.0 Jun 18, 2025
28 checks passed
@ncdiehl11 ncdiehl11 deleted the pd_feat-extend-referencevolume-util branch June 18, 2025 14:39
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