Skip to content
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

Merged
merged 18 commits into from
Feb 11, 2025
Merged

Y24-382: add example test cases #4641

merged 18 commits into from
Feb 11, 2025

Conversation

StephenHulme
Copy link
Contributor

@StephenHulme StephenHulme commented Jan 27, 2025

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

@StephenHulme StephenHulme self-assigned this Jan 27, 2025
@StephenHulme
Copy link
Contributor Author

StephenHulme commented Jan 27, 2025

This is ready for review, I think the failing feature tests are unrelated to the changes (and possibly solved by #4639).

@@ -261,31 +261,46 @@
end
end

# TODO: Y24-383 - add assertions for final source and destination volumes
Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor Author

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...?

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.49%. Comparing base (088dcf7) to head (d1f1c5b).
Report is 37 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

{ 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
Copy link
Contributor

@KatyTaylor KatyTaylor Jan 29, 2025

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?

Copy link
Contributor Author

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 😉

@@ -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']
Copy link
Contributor Author

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.

@@ -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']
Copy link
Contributor

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],
Copy link
Contributor

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?

Copy link
Contributor Author

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!

Copy link
Contributor Author

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.

@StephenHulme StephenHulme merged commit bf13288 into develop Feb 11, 2025
23 checks passed
@StephenHulme StephenHulme deleted the y24-382-add-test-cases branch February 11, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Y24-382 - Research - updating volume after cherrypicking
2 participants