Skip to content

feat(protocol-designer): cap flow rate at hardware maximum #18859

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
merged 2 commits into from
Jul 9, 2025

Conversation

ncdiehl11
Copy link
Collaborator

@ncdiehl11 ncdiehl11 commented Jul 8, 2025

Overview

This PR ensures that the interpolated liquid class flow rate for aspirate, dispense, and blowout does not exceed the range prescribed by the pipette liquid definition's plunger curves. To achieve this, we reuse the max flow rate logic in getMaxUiFlowRate in the liquid class form change handler utils, to make sure the populated flow rates from the liquid class are physically possible.

The code is a bit redundant in the various form change utils, but I am erring on the side of caution vs. DRY given the upcoming release. I can refactor the utilities in a followup post-release.

Closes RQA-4151

Test Plan and Hands on Testing

  • import the protocol attached to this ticket (titled RQA4151_updated.py)
  • edit the transfer step to transfer a volume of 1000µl (change destination labware if necessary)
  • select viscous liquid class
  • update liquid class values when prompted
  • confirm that all flow rates (aspirate, dispense, blowout) do not exceed the maximum shown in the flow rate caption

Changelog

  • implement hardware (UI) max flow rate logic in getLiquidClassValuesMoveLiquid and getLiquidClassValuesMix
  • refine types in getMaxUiFlowRate

Review requests

see test plan

Risk assessment

medium. touches core logic of liquid class value population

This PR ensures that the interpolated liquid class flow rate for aspirate, dispense, and blowout does not exceed the range prescribed by the pipette liquid definition's plunger curves. To achieve this, we reuse the max flow rate logic in `getMaxUiFlowRate` in the liquid class form change handler utils, to make sure the populated flow rates from the liquid class are physically possible.

Closes RQA-4151
@ncdiehl11 ncdiehl11 self-assigned this Jul 8, 2025
@ncdiehl11 ncdiehl11 requested a review from ddcc4 July 8, 2025 23:06
@ncdiehl11 ncdiehl11 marked this pull request as ready for review July 8, 2025 23:07
@ncdiehl11 ncdiehl11 requested a review from a team as a code owner July 8, 2025 23:07
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 3.26087% with 267 lines in your changes missing coverage. Please review.

Project coverage is 24.60%. Comparing base (e4ab7b3) to head (7731899).
Report is 1 commits behind head on chore_release-pd-8.5.0.

Files with missing lines Patch % Lines
...r/src/steplist/formLevel/handleFormChange/utils.ts 1.47% 267 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                     @@
##           chore_release-pd-8.5.0   #18859      +/-   ##
==========================================================
- Coverage                   24.62%   24.60%   -0.03%     
==========================================================
  Files                        3263     3263              
  Lines                      282679   282891     +212     
  Branches                    30247    30244       -3     
==========================================================
- Hits                        69602    69596       -6     
- Misses                     213057   213275     +218     
  Partials                       20       20              
Flag Coverage Δ
protocol-designer 19.09% <3.26%> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
...gner/ProtocolSteps/StepForm/PipetteFields/utils.ts 17.35% <100.00%> (-1.87%) ⬇️
...r/src/steplist/formLevel/handleFormChange/utils.ts 14.82% <1.47%> (-2.79%) ⬇️
🚀 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 requested review from jerader and removed request for a team July 9, 2025 13:29
@@ -1,3 +1,4 @@
import { min } from 'lodash'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
import { min } from 'lodash'
import min from 'lodash/min'

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.

it works with the example you added. hopefully this is it for tweaking flow rate 🤞 i wonder if some of these utils can be moved to step-generation or shared-data so quick transfer can use them too? not necessary to do it in this PR, you can do it next week.

@ncdiehl11
Copy link
Collaborator Author

it works with the example you added. hopefully this is it for tweaking flow rate 🤞 i wonder if some of these utils can be moved to step-generation or shared-data so quick transfer can use them too? not necessary to do it in this PR, you can do it next week.

Yep, I actually mentioned that to Koji on one of his PRs, and I believe he is ticketing that refactor. Especially getMaxUIFlowRate and all of the liquid class form change utils. It might need a bit of massaging to move out of PD, but not too bad.

@ncdiehl11 ncdiehl11 merged commit ce0f2a0 into chore_release-pd-8.5.0 Jul 9, 2025
15 of 16 checks passed
@ncdiehl11 ncdiehl11 deleted the feat_pd-ui-max-flow-rate branch July 9, 2025 14:28
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