Skip to content

Conversation

@d-morrison
Copy link
Collaborator

@d-morrison d-morrison commented Jan 5, 2026

Refactors y1 calculation in JAGS code by introducing change_y intermediate variable.

Shouldn't affect numerical results, as shown by the run_mod() snapshot tests.

Copilot AI review requested due to automatic review settings January 5, 2026 07:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the readability and maintainability of the JAGS model code by refactoring the calculation of y1 to use an intermediate variable and moving inline comments to separate lines for better clarity.

  • Extracted the change_y intermediate variable from the inline y1 calculation
  • Moved the explanatory comment about par[,,2] to a separate line
  • Improved code alignment for better readability

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
inst/extdata/model.jags Refactored y1 calculation by introducing change_y intermediate variable and improved comment placement
DESCRIPTION Version bump from 0.0.0.9044 to 0.0.0.9045 to reflect the code clarification

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Copilot AI review requested due to automatic review settings January 5, 2026 22:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

alpha[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,4]) # `nu` in the paper
shape[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,5]) + 1 # `r` in the paper
y0[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,1])
# par[,,2] is log(y1-y0):
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment "par[,,2] is log(y1-y0)" is technically imprecise. Based on the code, par[,,2] represents log(y1-y0), and when exponentiated it gives change_y = y1 - y0.

Consider revising the comment to be more explicit, such as: "par[,,2] represents log(change in y from baseline to peak)"

Suggested change
# par[,,2] is log(y1-y0):
# par[,,2] represents log(change in y from baseline (y0) to peak (y1)):

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants