Skip to content

Prepare v0.1.0 for first CRAN submission#207

Open
Kwan-Jenny wants to merge 53 commits into
mainfrom
cran-submission
Open

Prepare v0.1.0 for first CRAN submission#207
Kwan-Jenny wants to merge 53 commits into
mainfrom
cran-submission

Conversation

@Kwan-Jenny
Copy link
Copy Markdown
Collaborator

@Kwan-Jenny Kwan-Jenny commented May 11, 2026

Purpose

Prepare serodynamics v0.1.0 for first CRAN submission.

Per Ezra's note: polish enough to pass CRAN checks; in-progress PRs do not need to be finished first.

Critical fixes

  • Title: replaced the default placeholder with
    "Modeling Longitudinal Antibody Responses to Infection"
  • Description: expanded to a multi-sentence paragraph with 'JAGS' and 'serocalculator' in single quotes and DOI references
    (Teunis 2016; Teunis & van Eijkeren 2020)
  • Removed Remotes: field: serocalculator is on CRAN, so this field is no longer needed
  • Updated serocalculator dependency from 1.3.0.9037 (development version) to >= 1.4.0 (CRAN release)
  • Fixed R-CMD-check badge URL: was pointing to /UCD-SERG/dcm/, now points to /ucdavis/serodynamics/
  • Updated package URLs from UCD-SERG/serodynamics to ucdavis/serodynamics
  • Removed broken CodeFactor badge because the ucdavis/serodynamics CodeFactor URL currently returns 404

Other changes

  • Added CRAN and development installation instructions to README
  • Restructured NEWS.md with a v0.1.0 release header and feature summary
  • Created cran-comments.md
  • Converted DOI URLs in data documentation to \doi{} format
  • Wrapped heavy JAGS examples in \dontrun{}
  • Made plot_predicted_curve() examples/tests use ids consistently to match the function signature
  • Skipped heavy JAGS, plotting, and vdiffr tests unless RUN_HEAVY_TESTS=true
  • Regenerated README.md and Rd files

Check results

Local (devtools::check(remote = TRUE, manual = TRUE)):

  • 0 errors | 0 warnings | 2 notes
    • New submission
    • HTML manual validation skipped locally because tidy is not installed in the Posit Cloud environment

Win-builder (devtools::check_win_devel()):

  • Pending; results will be sent to the maintainer email

Next steps after Sam's review

  1. @sschildhauer reviews this PR and confirms the maintainer/submission plan.
  2. @sschildhauer runs devtools::submit_cran() from this branch.
  3. After CRAN accepts: merge this PR and create GitHub release v0.1.0.
  4. Bump main back to a development version with usethis::use_dev_version().

Related

- Update DESCRIPTION for CRAN readiness:
  - replace placeholder title
  - expand package description with DOI references
  - remove Remotes field
  - update serocalculator dependency to CRAN version
- Update README badges and installation instructions for ucdavis repo
- Add cran-comments.md and WORDLIST
- Update NEWS.md for v1.0.0 release
- Convert DOI URLs in data documentation to \doi{} format
- Reduce CRAN check burden:
  - wrap heavy run_mod example in \dontrun{}
  - use ids consistently in plot_predicted_curve examples
  - skip heavy JAGS and plotting tests unless RUN_HEAVY_TESTS=true
- Regenerate README.md and Rd files

Local check result: 0 errors, 0 warnings, 2 notes
@Kwan-Jenny Kwan-Jenny requested review from Copilot and sschildhauer and removed request for Copilot May 11, 2026 19:10
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.10%. Comparing base (b154122) to head (27d7363).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #207       +/-   ##
===========================================
- Coverage   81.42%   40.10%   -41.32%     
===========================================
  Files          25       25               
  Lines         915      915               
===========================================
- Hits          745      367      -378     
- Misses        170      548      +378     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

📖 https://ucd-serg.github.io/serodynamics/preview/pr207
Preview documentation for this PR (at commit 74da957)

- Remove library() calls from test code
- Use explicit package namespaces and skip_if_not_installed() where needed
- Keep heavy tests skipped unless RUN_HEAVY_TESTS=true
Copilot AI review requested due to automatic review settings May 11, 2026 20:04
Copy link
Copy Markdown
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

Prepares serodynamics v1.0.0 for an initial CRAN submission by updating package metadata/URLs, tightening examples to avoid heavy computations during checks, and gating slow/fragile tests behind an opt-in environment variable.

Changes:

  • Updated package metadata for CRAN readiness (Title/Description, version bump to 1.0.0, URLs, dependency minimums; removed Remotes).
  • Adjusted documentation/examples (DOI formatting via \\doi{}, wrapped heavy run_mod() example in \\dontrun{}; regenerated Rd/README).
  • Reduced CRAN/CI test burden by skipping heavy JAGS + vdiffr/plot tests unless RUN_HEAVY_TESTS=true.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/testthat/test-runjags.R Skips heavy runjags consistency tests on CRAN and unless RUN_HEAVY_TESTS=true.
tests/testthat/test-run_mod.R Gates multiple snapshot-heavy JAGS model tests behind CRAN + env-var skips.
tests/testthat/test-plot_predicted_curve.R Gates plotting tests behind CRAN + env-var skips (but still contains an id= call site that will error when enabled).
tests/testthat/test-plot_jags_tracedx.R Gates vdiffr trace plot snapshot test behind CRAN + env-var skips.
tests/testthat/test-plot_jags_rhatdx.R Gates vdiffr Rhat plot snapshot test behind CRAN + env-var skips.
tests/testthat/test-plot_jags_effectivedx.R Gates vdiffr ESS plot snapshot test behind CRAN + env-var skips.
tests/testthat/test-plot_jags_densitydx.R Adds CRAN/env-var skips and skip_if_not_installed() guards for Suggests packages.
tests/testthat/test-initsfunction.R Gates a runjags-based test behind CRAN + env-var skips.
README.Rmd Updates badges/URLs to ucdavis/serodynamics and adds CRAN install instructions.
README.md Regenerated from README.Rmd with updated badges/installation instructions.
R/nepal_sees.R Converts source DOI URL to Rd \\doi{} format in dataset documentation.
R/nepal_sees_jags_output.R Converts source DOI URL to Rd \\doi{} format in dataset documentation.
NEWS.md Restructures NEWS for the 1.0.0 initial CRAN release header/summary.
man/serodynamics-package.Rd Updates package-level Title/Description and GitHub URLs for CRAN.
man/run_mod.Rd Adds a lightweight example using precomputed data and wraps heavy JAGS example in \\dontrun{}.
man/plot_predicted_curve.Rd Updates examples to use ids argument and adjusts show_all_curves in examples.
man/nepal_sees.Rd Converts DOI URL to \\doi{} in Rd output.
man/nepal_sees_jags_output.Rd Converts DOI URL to \\doi{} in Rd output.
inst/WORDLIST Adds words needed for spelling checks (e.g., “seroepidemiologic”, “Eijkeren”).
inst/examples/run_mod-examples.R Adds a lightweight example + attempts to wrap heavy example in \\dontrun{} (but introduces non-R markup into an example script).
inst/examples/examples-plot_predicted_curve.R Updates example script to use ids argument and adjusts show_all_curves.
DESCRIPTION CRAN-ready metadata updates: Title/Description, version 1.0.0, URLs, dependency floor, remove Remotes.
cran-comments.md Adds CRAN submission comments template/check results.
.Rbuildignore Excludes CRAN comments and common build artifacts (doc/, Meta/).
.gitignore Ignores doc/ and Meta/ directories.

Comment thread inst/examples/run_mod-examples.R Outdated
Comment thread tests/testthat/test-plot_jags_tracedx.R
Comment thread tests/testthat/test-plot_jags_rhatdx.R
Comment thread tests/testthat/test-plot_jags_effectivedx.R
Comment thread cran-comments.md Outdated
Comment thread tests/testthat/test-plot_predicted_curve.R
- Pin setup-r action to v2 instead of HEAD
- Use runjags::findjags() consistently in the JAGS setup step
sschildhauer
sschildhauer previously approved these changes May 13, 2026
Copy link
Copy Markdown
Collaborator

@sschildhauer sschildhauer left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment thread cran-comments.md Outdated
Copilot AI review requested due to automatic review settings May 13, 2026 20:52
Copy link
Copy Markdown
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 20 out of 26 changed files in this pull request and generated 3 comments.

Files not reviewed (5)
  • man/nepal_sees.Rd: Language not supported
  • man/nepal_sees_jags_output.Rd: Language not supported
  • man/plot_predicted_curve.Rd: Language not supported
  • man/run_mod.Rd: Language not supported
  • man/serodynamics-package.Rd: Language not supported

Comment thread inst/examples/run_mod-examples.R Outdated
Comment thread cran-comments.md Outdated
Comment thread tests/testthat/test-run_mod.R
@Kwan-Jenny
Copy link
Copy Markdown
Collaborator Author

@copilot Please update all references in this repository from ucdavis/serodynamics to UCD-SERG/serodynamics. Search across all files, including documentation, README, vignettes, workflows, metadata, and config files. Replace old GitHub URLs such as https://github.com/ucdavis/serodynamics with https://github.com/UCD-SERG/serodynamics, and avoid unrelated changes.

Agent-Logs-Url: https://github.com/UCD-SERG/serodynamics/sessions/d12cbd03-c85a-4b2c-be7a-5fedf8b5b411

Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 00:20
@Kwan-Jenny Kwan-Jenny review requested due to automatic review settings May 14, 2026 00:20
Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

@copilot Please update all references in this repository from ucdavis/serodynamics to UCD-SERG/serodynamics. Search across all files, including documentation, README, vignettes, workflows, metadat...

Updated all ucdavis/serodynamics references to UCD-SERG/serodynamics across the repo and regenerated derived docs (README.md, man/serodynamics-package.Rd). Addressed in commit 9d74139.

@Kwan-Jenny
Copy link
Copy Markdown
Collaborator Author

@claude d-morrison suggested keeping show_all_curves = TRUE, but reducing the runtime another way, for example by subsetting the MCMC samples. Could you please revert show_all_curves back to TRUE in inst/examples/examples-plot_predicted_curve.R, and then make the example run faster by using fewer/subsetted posterior MCMC draws instead?

Since man/plot_predicted_curve.Rd is auto-generated, please also rerun devtools::document() after updating the example so the Rd file is updated consistently.

Please keep the change minimal and focused on preserving the intended example behavior while reducing runtime.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 18, 2026

Claude finished @Kwan-Jenny's task in 2m 8s —— View job


Reverted show_all_curves and optimized example runtime

  • Read inst/examples/examples-plot_predicted_curve.R and understand current state
  • Read man/plot_predicted_curve.Rd and R/plot_predicted_curve.R for reference
  • Understood the data structure: nepal_sees_jags_output has 500 iterations × 2 chains = 1,000 samples per (subject, antigen_iso)
  • Reverted show_all_curves = FALSETRUE in all four calls
  • Added dplyr::filter(Iteration <= 50) to subset to 50 of 500 iterations (100 samples vs. 1,000 = ~10× faster)
  • Updated man/plot_predicted_curve.Rd to match (since devtools::document() cannot be run in this environment, the Rd was updated manually to be consistent)
  • Committed and pushed as 3cda5a3

What changed

In inst/examples/examples-plot_predicted_curve.R (and mirrored into man/plot_predicted_curve.Rd):

# Before
sees_model <- serodynamics::nepal_sees_jags_output

# After
sees_model <- serodynamics::nepal_sees_jags_output |>
  dplyr::filter(Iteration <= 50)  # use 50 of 500 iterations for faster examples

All four show_all_curves = FALSE values were reverted to TRUE. The subsetting reduces the per-example computation from ~241,000 rows (1,000 samples × 241 time points) to ~24,100 rows (100 samples × 241 time points), keeping runtime manageable while correctly demonstrating the feature.

Note: Since devtools::document() couldn't be run in this CI environment, the Rd file was updated manually to match. The maintainer may want to run devtools::document() locally before the CRAN submission to ensure the Rd is generated through the normal toolchain.

Reverts show_all_curves = FALSE -> TRUE in all four plot_predicted_curve()
examples, and subsets nepal_sees_jags_output to the first 50 of 500
iterations (dplyr::filter(Iteration <= 50)) to keep example runtime
manageable without hiding the feature.

Co-authored-by: Kwan-Jenny <Kwan-Jenny@users.noreply.github.com>
@Kwan-Jenny
Copy link
Copy Markdown
Collaborator Author

@claude review

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 18, 2026

Claude finished @Kwan-Jenny's task in 1m 58s —— View job


CRAN Submission Review — PR #207

  • Read CLAUDE.md and gather repo context
  • Review DESCRIPTION and package metadata
  • Review test files and skip guards
  • Review examples and documentation
  • Review NEWS.md, cran-comments.md, README
  • Compile final review

Overall assessment

The PR is CRAN-ready. All previously flagged issues from prior review cycles have been resolved. There are no remaining actionable issues. One minor advisory is noted below.


All previously flagged issues resolved ✓

show_all_curves in examples (flagged in every prior review): show_all_curves = TRUE in all four calls in inst/examples/examples-plot_predicted_curve.R and consistently mirrored in man/plot_predicted_curve.Rd. The MCMC subsetting (dplyr::filter(Iteration <= 50)) keeps example runtime manageable while correctly demonstrating the feature. ✓

DESCRIPTION

  • Title, Description, Version 0.1.0, URLs, BugReports all correct
  • SystemRequirements: JAGS (>= 4.3.1) present and consistent with cran-comments.md
  • serocalculator (>= 1.4.1) — CRAN release floor, Remotes: field removed
  • ORCIDs added for all five authors
  • No duplicate readr in Config/needs/test

Test skip guards

  • All five vdiffr-using test files (test-plot_jags_densitydx.R, test-plot_jags_rhatdx.R, test-plot_jags_effectivedx.R, test-plot_jags_tracedx.R, test-plot_predicted_curve.R) have skip_on_cran() + RUN_HEAVY_TESTS + skip_if_not_installed("vdiffr") in the correct order ✓
  • test-run_mod.R, test-runjags.R, test-initsfunction.R correctly gated ✓
  • No spurious skip_if_not_installed("dplyr") — correct since dplyr is in Imports

CI workflows

  • r-lib/actions pinned to @v2 (not @HEAD) in R-CMD-check.yaml
  • runjags::findjags() (lowercase) in R-CMD-check.yaml
  • RUN_HEAVY_TESTS: "true" in test-coverage.yaml — restores heavy-test coverage ✓

inst/examples/run_mod-examples.R

  • Valid R (no Rd markup at top level)
  • Runtime guard if (interactive() && !is.element(runjags::findjags(), c("", NULL)))

cran-comments.md

  • Reflects actual win-builder result (1 NOTE, new submission) ✓
  • SystemRequirements mention consistent with DESCRIPTION ✓

README.Rmd

  • CRAN install block gated with "Once accepted on CRAN" caveat ✓
  • pak::pak("UCD-SERG/serodynamics") for dev install ✓
  • R-CMD-check badge pointing to correct repo ✓

NEWS.md

  • # serodynamics 0.1.0 header with release summary at top ✓
  • ## New features / ## Bug fixes / ## Developer-facing changes sections ✓

Advisory (no action required for this submission)

runjags::findJAGS() in .github/workflows/test-coverage.yaml line 61

R-CMD-check.yaml was updated to use runjags::findjags() (lowercase), but test-coverage.yaml still has the older runjags::findJAGS() capitalization. The two forms are likely aliases in the runjags package and both may work at runtime, so this is unlikely to break CI. Since I cannot modify workflow files, this can be addressed in a follow-up PR after the CRAN submission.


Summary: No changes needed. The package is ready for devtools::submit_cran() from this branch.

@d-morrison
Copy link
Copy Markdown
Member

@claude resolve conflicts

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude finished @d-morrison's task in 4m 19s —— View job


Conflicts resolved

  • Gather context
  • Check current branch state vs main — repo is a shallow clone; main was 1 commit ahead (PR ci: let @claude run R and file follow-up issues #218)
  • Identify conflicts — NEWS.md, inst/WORDLIST, and DESCRIPTION had diverged; workflow files also differ but cannot be modified
  • Resolve conflicts in NEWS.md and WORDLIST
  • Commit 59bc846 and push

What changed:

File Resolution
DESCRIPTION No change needed — Version: 0.1.0 on cran-submission is the correct CRAN release version; ignoring main's dev bump to 0.0.0.9054
NEWS.md Added PR #218 entries ("Expanded @claude workflow" + "Standardized runjags::findjags() casing") to ## Developer-facing changes
inst/WORDLIST Added 4 words from PR #218: allowlist, libs, pandoc, toolchain in sorted order

Workflow files (cannot modify):

The following workflow-file differences from main were not applied because GitHub App permissions do not allow .github/workflows/ edits:

These can be applied manually in a follow-up commit by @d-morrison or @Kwan-Jenny, or accepted at merge time.

github-actions Bot and others added 2 commits May 19, 2026 00:31
Co-authored-by: Douglas Ezra Morrison <d-morrison@users.noreply.github.com>
Same three-way conflict as the previous main → cran-submission merge:

* DESCRIPTION — kept the 0.1.0 release Title and version from
  cran-submission. Main's dev version (0.0.0.9054 after #218) is
  superseded.
* NEWS.md — kept cran-submission's "first CRAN release" intro and
  0.1.0 structure. All of main's incoming dev-version bullets
  (#218 R toolchain + gh issue allowlist, findjags casing,
  #210/#216/#217, OS-snapshot consolidation, Copilot decomposition)
  are already represented under ## Developer-facing changes from
  the prior merge and the "Incorporate PR #218 changes" cherry,
  so the main-side block is dropped rather than re-merged.
* inst/WORDLIST — union of both branches, ASCII-sorted, CRLF
  preserved.

Workflow files (.github/workflows/{claude,copilot-setup-steps,
test-coverage}.yml) auto-merged to main's version, so cran-submission
now inherits #218's @claude R toolchain, gh issue allowlist, and
the lowercase runjags::findjags() consistency fix in test-coverage
and copilot-setup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@d-morrison
Copy link
Copy Markdown
Member

@claude review

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude finished @d-morrison's task in 1m 42s —— View job


CRAN Submission Review — PR #207

  • Gather context and check current branch state
  • Review DESCRIPTION and package metadata
  • Review test files and skip guards
  • Review examples and documentation
  • Review NEWS.md, cran-comments.md, README
  • Compile final review

Overall assessment

The PR is CRAN-ready. All issues raised in previous review cycles have been resolved, including the show_all_curves revert (confirmed TRUE in all four example calls), the findjags() casing fix (now lowercase in both workflow files), and the Remotes: field removal. No actionable issues remain.


All checks passing ✓

DESCRIPTION

  • Title, Description, Version 0.1.0, URLs, BugReports all correct ✓
  • SystemRequirements: JAGS (>= 4.3.1) present and consistent with cran-comments.md
  • serocalculator (>= 1.4.1) — CRAN release floor; Remotes: field absent ✓
  • ORCIDs added for all five authors ✓
  • No duplicate readr in Config/needs/test

Test skip guards

  • All five vdiffr-using test files have skip_on_cran() + RUN_HEAVY_TESTS + skip_if_not_installed("vdiffr") in the correct order ✓
  • test-run_mod.R (five test blocks), test-runjags.R, test-initsfunction.R all correctly gated ✓
  • runjags:::example_runjags() in test-runjags.R is double-gated by skip_on_cran() + RUN_HEAVY_TESTS — acceptable; ::: in test files is not flagged by R CMD check --as-cran

CI workflows

  • r-lib/actions pinned to @v2 in R-CMD-check.yaml
  • runjags::findjags() (lowercase) now in both R-CMD-check.yaml and test-coverage.yaml
  • RUN_HEAVY_TESTS: "true" set in test-coverage.yaml — heavy tests will run for coverage ✓

Examples and documentation

  • show_all_curves = TRUE in all four calls in inst/examples/examples-plot_predicted_curve.R and consistently mirrored in man/plot_predicted_curve.Rd
  • MCMC subsetting to 50 iterations (dplyr::filter(Iteration <= 50)) keeps runtime manageable while correctly demonstrating the feature ✓
  • ids argument used consistently across all calls (no stray id =) ✓
  • inst/examples/run_mod-examples.R is valid R; if (interactive() && !is.element(runjags::findjags(), c("", NULL))) guard correct; explicit dplyr:: namespacing ✓

cran-comments.md

  • Reflects 1 NOTE (new submission); win-builder result included ✓
  • SystemRequirements mention consistent with DESCRIPTION ✓

NEWS.md

  • # serodynamics 0.1.0 header with release summary at top ✓
  • ## New features / ## Bug fixes / ## Developer-facing changes sections ✓

README.Rmd / README.md

  • CRAN install block gated with "Once accepted on CRAN" caveat ✓
  • pak::pak("UCD-SERG/serodynamics") for dev install ✓
  • R-CMD-check badge pointing to UCD-SERG/serodynamics (broken CodeFactor badge removed) ✓

Summary: No changes needed. The package is ready for devtools::submit_cran() from this branch.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

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

Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Release serodynamics 1.0.0

7 participants