-
Notifications
You must be signed in to change notification settings - Fork 4
fix false-> true #149
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
base: main
Are you sure you want to change the base?
fix false-> true #149
Conversation
Code Coverage SummaryDiff against mainResults for commit: 3d83aec Minimum allowed coverage is ♻️ This comment has been updated with latest results |
danielinteractive
left a comment
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.
As usual when there is a bug fix can you please add a test that first reproduces the bug and then is fixed with this change?
Unit Tests Summary 1 files 20 suites 9m 44s ⏱️ For more details on these failures and errors, see this check. Results for commit f25bf7a. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit 2879ab0 ♻️ This comment has been updated with latest results. |
danielinteractive
left a comment
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 @audreyyeoCH !
danielinteractive
left a comment
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.
Good to go from my side already before, but you first have to fix the check errors
thanks @danielinteractive, did you see the comment from above ? I wasn't able to get a link |
| # h_predprobdist ---- | ||
| test_that("h_predprobdist gives correct list", { | ||
| result <- h_predprobdist( | ||
| warnings <- capture_warnings(result <- h_predprobdist( |
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.
Hi @danielinteractive , in h_getBetamixPost, I added a warning a few issues ago, for input weights that don't add up to 1. The test for anything that relies on this helper therefore needs to handle the repeated warnings and I found this solution.
This solution may be measured to the risk of the wrong user weight input. If we believe so, we can incorporate the multiple warnings in the test, to ensure it gives the correct number of the same warnings.
This solution may be seen as an overkill - if we remove the warning of "Weights have been corrected", and someone decides to add it later on, it will cause a chain of warnings again in all the call functions that have h_getBetamixPost as their helper function.
Thought I'd check in with your views on the what the risk vs benefit is before I add it to the other tests. Thanks!
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 @audreyyeoCH , good point. I think for the tests it might be ok, but I am more concerned then about the user experience: Is this helper function called inside simulation loops somewhere e.g. and might trigger as many warnings as there are simulation iterations?
If yes, I think we need to do something about it.
However, for the topic of this PR this seems tangential at best, so it would be better to handle this in a separate issue / PR if possible. That is, can we not leave this particular test as it was before in this PR?
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 looking into it @danielinteractive.
Is this helper function called inside simulation loops somewhere e.g. and might trigger as many warnings as there are simulation iterations?
edit: the number of warnings is not the number of simulations. It is the number of arms + number of posteriors calculated * number of arms. In addition, the number of warnings is capped at 50, with this warning
There were 50 or more warnings (use warnings() to see the first 50)
The number of posteriors in this scenario is:
for active arm : 17 patients left to recruit, therefore 18 possible results (0....17 responders)
for control arm: 10 patients left to recruit, therefore 11 possible results (0...11 responders).
This is an array of 18 x 11 elements, making it a total of 198 possible combination of results from each arm. We have two warnings per posterior because there are 2 arms, making it a sum of 396 warnings.
plus the posterior from calculating each arm. This is 2.
In total it is 396 + 2 warnings = 398 warnings. The number of same warnings is 398.
I do not believe it affects the user experience, because of the one line of warning above. Thus I feel we can go either way to carry on with ensuring all tests capture warnings or completely remove the warning from h_getBetamixPost, such that the user carries their own risk of mis-specifying their weights since ... $params will show what weights were used. What do you think ?
However, for the topic of this PR this seems tangential at best, so it would be better to handle this in a separate issue / PR if possible. That is, can we not leave this particular test as it was before in this PR?
I agree it seems tangential, but it is causing the checks not to pass. Is there another way around this that I am not seeing ?
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.
OK I ran checks on the main branch and they are failing because of the warnings (and few other things):
https://github.com/Genentech/phase1b/actions/runs/20737971973/job/59539040271
I would recommend to first make a separate issue/PR to fix this, get the main branch into a clean state, and then continue with this issue/PR.
As an idea for the fix, I think so many warnings are just too many. Either we move the warning up to the user level function such that it is only given once per user call. Or we just don't warn.
closes #146