Add plot_serocurve() for population-level serodynamic curve visualization#193
Add plot_serocurve() for population-level serodynamic curve visualization#193Copilot wants to merge 19 commits into
plot_serocurve() for population-level serodynamic curve visualization#193Conversation
Agent-Logs-Url: https://github.com/ucdavis/serodynamics/sessions/18e7ea90-f52f-49ce-a5fb-4e77aec451d2 Co-authored-by: sschildhauer <165851188+sschildhauer@users.noreply.github.com>
plot_serocurve() for population-level serodynamic curve visualization
There was a problem hiding this comment.
@copilot Please create a new branch for this PR entitlted plot_serocurve. Also, this PR should use the code from branch mon_popparams, which as already established an attribute that holds mu.par. Please do not modify any other existing functions or tests in order to create the new plot_serocurve function. Do not modify run_mod or its outputs from the mon_popparams branch. The visualizations look good as is. Keep all edits in this thread. Do not open another pull request.
|
@sschildhauer I've opened a new pull request, #194, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot Please create a new branch for this PR entitlted plot_serocurve. Also, this PR should use the code from branch mon_popparams, which as already established an attribute that holds mu.par. Please do not modify any other existing functions or tests in order to create the new plot_serocurve function. Do not modify run_mod or its outputs from the mon_popparams branch. The visualizations look good as is. Keep all edits and recommendations in this thread. Do not open another pull request. |
…correct population_params format Agent-Logs-Url: https://github.com/ucdavis/serodynamics/sessions/6f0bb3ad-fcef-4813-b663-5194422cd517 Co-authored-by: sschildhauer <165851188+sschildhauer@users.noreply.github.com>
Done (commit
Done (commit |
sschildhauer
left a comment
There was a problem hiding this comment.
@copilot please address all feedback and comments given in this review. Please keep all changes in the same thread for this pull request.
…tion to predictive distribution Agent-Logs-Url: https://github.com/ucdavis/serodynamics/sessions/64eb25a1-7d2a-4ab5-b24a-5dc03686f3ee Co-authored-by: sschildhauer <165851188+sschildhauer@users.noreply.github.com>
All review feedback addressed in commit
|
|
@claude, Please fix the warning in the plot_serocurve test set. |
|
Claude finished @sschildhauer's task in 3m 0s —— View job Fix warning in plot_serocurve test set
What was wrongCI surfaced this warning in The triggering case was The fixWrapped if (!multi_strat) {
p <- p + ggplot2::scale_color_manual(...)
if (show_ci) {
p <- p + ggplot2::scale_fill_manual(...)
}
}VerificationRan All 7 tests pass with zero warnings. The existing vdiffr snapshot for Branch · |
Move `scale_fill_manual()` inside an `if (show_ci)` guard so it is only added when a CI ribbon is actually drawn. Previously the fill scale was applied unconditionally for single-stratification plots, producing "No shared levels found between names(values) of the manual scale and the data's fill values" when show_ci was FALSE — which triggered an R CMD check failure on the `serocurve-population-no-ci` test. Co-authored-by: Samuel Hisaji Schildhauer <sschildhauer@users.noreply.github.com>
|
@claude, please review PR. |
|
Claude finished @sschildhauer's task in 2m 26s —— View job PR Review
SummaryThis PR has been substantially scoped down from earlier iterations: it now adds only CI status: all substantive checks pass — R-CMD-check, test-coverage, spellcheck, version check, pkgdown, lint, NEWS check, docs check, README check. (The one "Claude Code Review" failure is the bot run, not a test failure.) The previously failing Findings —
|
| Priority | Item |
|---|---|
| Moderate | Add empty-result guard for the newperson path (finding 1) |
| Minor | Hardcoded tx grid (finding 2) — defer if desired |
| Minor | Lift duplicated antigen_iso_col assignment (finding 3) |
| Minor | Document or fix antigen_iso/strat default-source asymmetry (finding 4) |
| Cosmetic | Merge plot_serocurve into the existing plot reference group (finding 5) |
None of these block merge. Finding 1 is the only one I'd flag as worth doing before shipping — the rest are polish.
· Branch
|
@claude, please make the suggested changes in this thread. |
|
Claude finished @sschildhauer's task in 3m 28s —— View job Applied suggested changes from this thread
What changed
VerificationAlso manually verified:
|
- Add empty-result guard for newperson param_source that errors with an actionable message when no newperson rows match the requested antigen- isotype/stratification, instead of silently producing an empty plot. - Clamp the tx time grid to xlim when supplied, avoiding unnecessary computation outside the visible range. - Lift duplicated antigen_iso_col assignment above the if/else. - Document the antigen_iso/strat default-source asymmetry (defaults come from the subject-level draws while population samples come from the population_params attribute). - Move plot_predicted_curve into the "Visualize model results" pkgdown reference section so plot_serocurve is no longer an orphaned entry. Co-authored-by: Samuel Hisaji Schildhauer <sschildhauer@users.noreply.github.com>
|
@Kwan-Jenny, This PR is ready for review |
Kwan-Jenny
left a comment
There was a problem hiding this comment.
Looks good. The function is well documented and the examples/snapshots cover the main cases.
One small thing:
nepal_sees_jags_output.rdagrew from ~226KB to ~731KB (from the new population_params). Makes sense, just flagging it since it ships with the package.
|(OR) assertions in test-internal-popparams.R:106-107 to useall()ensuring both subjects and parameters are presentdplyr::rename(c("new" = "old", ...))to standardrename(new = "old", ...)form in Run_Mod.Rdplyr::select(!c(...))toselect(-all_of(...))in Run_Mod.R