-
Notifications
You must be signed in to change notification settings - Fork 33
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
Y24-382: add example test cases #4641
Conversation
This is ready for review, I think the failing feature tests are unrelated to the changes (and possibly solved by #4639). |
spec/models/well_spec.rb
Outdated
@@ -261,31 +261,46 @@ | |||
end | |||
end | |||
|
|||
# TODO: Y24-383 - add assertions for final source and destination volumes |
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'm half wondering if this should happen as part of this PR to lay a groundwork of completed calculations for a potential meeting with relevant parties next week...
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.
When you say "final source and destination volumes", you mean "current_volume" in well attributes, on the source and target wells - is that right?
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.
Great idea to add these assertions though
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'm not sure... current_volume
seems somewhat time invarient to me - I'm not sure at what stage it is current! What I mean is how much volume is left in the original well on the original plate, and how much has been pipetted into the new well in the new plate.
But I think we are talking the same thing...?
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.
Sorry should have submitted all these comments in one go...
Is it possible to check the target well's final volume in this test, because that gets updated after bed verification?
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.... that makes sense why it isn't in this calculation at the moment... 🙈 There are calculations for that, I'll have a look and try add it to this PR.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4641 +/- ##
===========================================
+ Coverage 87.18% 89.49% +2.30%
===========================================
Files 1406 1406
Lines 30296 30630 +334
===========================================
+ Hits 26415 27412 +997
+ Misses 3881 3218 -663 ☔ View full report in Codecov by Sentry. |
spec/models/well_spec.rb
Outdated
{ target_ng: 10_000, measured_conc: 250, measured_vol: 50, min_vol:10, min_pick_vol: 1, source_pick_vol: 40, buffer_vol: 0, current_vol: nil }, | ||
{ target_ng: 10_000, measured_conc: 250, measured_vol: 30, min_vol:10, min_pick_vol: 1, source_pick_vol: 30, buffer_vol: 0, current_vol: nil }, | ||
{ target_ng: 1000, measured_conc: 70, measured_vol: 50, min_vol:10, min_pick_vol: 5, source_pick_vol: 14.29, buffer_vol: 0, current_vol: nil },# Y24-382: SQPD-10861 v14.29, b0.00 | ||
{ target_ng: 200, measured_conc: 200, measured_vol: 1, min_vol:50, min_pick_vol: 5, source_pick_vol: 1, buffer_vol: 49, current_vol: nil }, # Y24-382: SQPD-10864 v1.00, b49.00 |
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 this one (above) will pass currently, but when Y24-383 is done it should be v5.00, b45.00 - is that right?
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 required volume < robot minimum picking volume, round up to the robot minimum picking volume
By the logic quoted, yes I think so.
My plan is to create a number of worked examples/scenarios, and liase with the stakeholders in Y24-383 to confirm which results are expected. Then make the algorithm match those expectations - Test Driven Development for the win 😉
spec/models/well_spec.rb
Outdated
@@ -437,7 +452,8 @@ | |||
[100.0, 5.0, 100.0, 2.0, 5.0, 5.0, 98.0, 'Less DNA than robot minimum pick'], | |||
[100.0, 50.0, 1.0, 200.0, 5.0, 100.0, 0.0, 'Low concentration, maximum DNA, no buffer'], | |||
[120.0, 50.0, 0, 60.0, 5.0, 60.0, 60.0, 'Zero concentration, with less volume than required'], | |||
[120.0, 50.0, 0, 3.0, 5.0, 5.0, 117.0, 'Zero concentration, with less volume than even the minimum robot pick'] | |||
[120.0, 50.0, 0, 3.0, 5.0, 5.0, 117.0, 'Zero concentration, with less volume than even the minimum robot pick'], | |||
[15.0, 50.0, 70.0, 50, 5.0, 10.7, 5.0, 'Y24-382: SQPD-10859 v10.71 b5.00'] |
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.
The v10.71, b5.00 example is a concentration example, rather than an amount example.
spec/models/well_spec.rb
Outdated
@@ -437,7 +452,8 @@ | |||
[100.0, 5.0, 100.0, 2.0, 5.0, 5.0, 98.0, 'Less DNA than robot minimum pick'], | |||
[100.0, 50.0, 1.0, 200.0, 5.0, 100.0, 0.0, 'Low concentration, maximum DNA, no buffer'], | |||
[120.0, 50.0, 0, 60.0, 5.0, 60.0, 60.0, 'Zero concentration, with less volume than required'], | |||
[120.0, 50.0, 0, 3.0, 5.0, 5.0, 117.0, 'Zero concentration, with less volume than even the minimum robot pick'] | |||
[120.0, 50.0, 0, 3.0, 5.0, 5.0, 117.0, 'Zero concentration, with less volume than even the minimum robot pick'], | |||
[15.0, 50.0, 70.0, 50, 5.0, 10.7, 5.0, 'Y24-382: SQPD-10859 v10.71 b5.00'] |
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 this will need to be updated after Y24-383, to be v10.71, b4.29, I think? (and still 15 final volume)
@@ -262,31 +262,184 @@ | |||
end | |||
|
|||
[ | |||
[1000, 10, 50, 50, 0, nil], | |||
[1000, 10, 10, 10, 0, nil], | |||
[1000, 10, 20, 10, 0, 10], |
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.
Have you lost this third scenario, where the 'current volume' (of the source well) is 10? Does the current volume of the source plate get used in the calculation? Or is it the measured volume that is checked?
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.
Thanks for picking this up, I'll double-check!
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 is an intentional change, outlined in 2aa1b7a
In the original tests, both measured_volume
and current_volume
(at start) are stipulated, providing some ambiguity about which value is being used in the picking algorithm. This is resolved by the estimated_volume
method which I've broken out into a separate test in this same commit.
In summary, there is no decrease in test scenario coverage with the implied test now being explicited checked in spec/models/well_attribute_spec.rb
.
Closes #4412
Changes proposed in this pull request
Instructions for Reviewers
[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to
main
]- Check story numbers included
- Check for debug code
- Check version