refactor(api): height from volume binary search#18081
Merged
caila-marashaj merged 9 commits intoedgefrom Apr 30, 2025
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## edge #18081 +/- ##
===========================================
- Coverage 57.52% 25.67% -31.85%
===========================================
Files 3043 2938 -105
Lines 255340 227623 -27717
Branches 30544 27497 -3047
===========================================
- Hits 146879 58446 -88433
- Misses 108275 169160 +60885
+ Partials 186 17 -169
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
93d653b to
13bb526
Compare
sfoster1
requested changes
Apr 22, 2025
Member
sfoster1
left a comment
There was a problem hiding this comment.
there's definitely a limit to the number of checks that we'll require, but it's still generally iffy to do a bunch of recursion in python (sadly!) because it can have a pretty heavy stack frame, so let's make this not recursive.
Let's also get this tested with hypothesis if we can, or ideally with some pretty rigorous numerics testing beyond just the boundary tests.
other than that, looks great!
084d34a to
3e79491
Compare
sfoster1
approved these changes
Apr 30, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 16, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 16, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 16, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 16, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 16, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 16, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 17, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 17, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 17, 2025
ddcc4
pushed a commit
that referenced
this pull request
May 17, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 17, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 17, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 17, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 17, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 17, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 19, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 19, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 19, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 20, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 20, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 22, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 23, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 24, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 24, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 29, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 29, 2025
(cherry picked from commit 5af0934)
ddcc4
pushed a commit
that referenced
this pull request
May 29, 2025
(cherry picked from commit 5af0934)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
For circular frusta, you can use calculus to determine a volume from a height, and not a height from a volume (the equation isolating height is a higher degree polynomial and gets pretty gross to try and solve analytically). The way we were getting around this before was by creating a lookup table during a protocol run, when a labware was loaded with a
CircularFrustum, at a fixed interval of every 0.5 mm to maintain accuracy. This became a problem for very tall circular frusta (like test tubes), and protocols that used them with this code would silently pause for 2 minutes at the start to fill out these very large tables.This implements a binary search instead to find a height from a volume within a circular frustum, upon request.