Fix package dependencies, namespace exports, and package infrastructure#12
Fix package dependencies, namespace exports, and package infrastructure#12Kwan-Jenny merged 11 commits intomanuscriptfrom
Conversation
- Move tibble, tidyr, purrr from Suggests to Imports - Add serocalculator and rlang to Imports - Remove unused cohort_name selection in process_shigella_data - Replace serodynamics::: calls with internal helper functions - Add utils_internal.R with get_timeindays_var() and ab() implementations Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
- Add testthat tests for main functions - Add R CMD check and pkgdown GitHub Actions workflows - Add data-raw/ with mock data generation script - Add R/data.R with mock data documentation - Add getting-started vignette - Update README.Rmd with package overview and usage - Update .Rbuildignore to exclude non-package files Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
Use base R rnorm() instead of non-existent rlang::rnorm() Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
Set explicit GITHUB_TOKEN permissions (contents: read) for security Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
Update comment to reflect internal implementation instead of external ::: call Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
|
@copilot I've reviewed all 18 changed files in this PR. Most changes look good, but there are several issues that need to be fixed before merging. Please address them in order: 1. Critical: Verify
|
| # | File | Action | Priority |
|---|---|---|---|
| 1 | R/utils_internal.R |
Verify ab() matches serodynamics:::ab() exactly |
Critical |
| 2 | R/utils_internal.R |
Verify get_timeindays_var() matches original |
Important |
| 3 | tests/testthat/test-model_comparison_table.R |
Remove skip_if_not_installed lines | Important |
| 4 | tests/testthat/test-compute_residual_metrics.R |
Remove unnecessary skips | Important |
| 5 | tests/testthat/test-utils_internal.R |
Create new test file (code provided above) | Important |
| 6 | DESCRIPTION |
Move purrr back to Suggests if unused in R/ |
Minor |
| 7 | R/utils_internal.R |
Add source reference comment | Minor |
Please address items 1-5 first, then 6-7. Thanks!
|
@Kwan-Jenny The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
Check again above comment @copilot |
Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/d36469e9-e5db-41bb-ad8f-cc452230b453
|
@Kwan-Jenny The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
1 similar comment
|
@Kwan-Jenny The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
... Addressed in commit
Targeted test execution could not be run in this sandbox because Screenshot: N/A (no UI changes; code/test-only update).
Re-checked and completed. The requested fixes from the prior comment are now applied in commit Screenshot: N/A (no UI changes; code/test-only update). |
|
@Kwan-Jenny The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
2 similar comments
|
@Kwan-Jenny The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
|
@Kwan-Jenny The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
Codecov Report❌ Patch coverage is
|
|
@copilot All 3 CI failures (docs-check, test-coverage, lint-changed-files) have the same root cause. The package fails to load because of namespace/export issues. Please fix both: Error 1:
|
Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/1327221c-702c-4c06-907f-1b381d75ecd9 Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
... Fixed in commit
This addresses the shared package-load root cause seen in docs-check, test-coverage, and lint-changed-files. Screenshot: N/A (no UI changes; code/package metadata/data files only). Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Good job! — the namespace/export issue is fixed and the package now installs successfully. Two remaining CI failures: 1. docs-check: DESCRIPTION out of syncThe "Check for changed files" step shows that running 2. test-coverage: testthat tests failingThe package installs fine now, but devtools::test()The most likely cause is one of these:
Please fix all failing tests and then run |
…xygen note Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/47d8cc5c-e58f-4f67-a13f-b5f56651a62e Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
... Addressed in commit
Screenshot: N/A (no UI changes; code/docs metadata only). |
|
@copilot Two remaining failures: 1. docs-check: NAMESPACE still out of syncThe CI runs Fix: Run 2. lint-changed-files: Three categories of lint issuesA.
|
Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/d635bda4-41b7-4feb-8fc3-330a60fec1ac Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
... Done in commit
Targeted verification run: Screenshot: N/A (no UI changes; code/lint/docs updates only). |
|
file: R/compute_residual_metrics.R Please fix the indentation on this line to use 6 spaces instead of 13, consistent with the project’s linting rules. Suggested fix:
After correction, run: lintr::lint_package() |
Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/6af850e8-229a-4ffd-a552-ff9467c5bbbb Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
Fixed in commit The indentation in I attempted to run Screenshot: N/A (no UI changes; formatting-only update). |
There was a problem hiding this comment.
Pull request overview
This PR tightens the package’s dependency/namespace setup, removes reliance on non-exported upstream functions (:::) by adding internal equivalents, and adds package infrastructure (tests, mock datasets, CI, docs) to resolve package-load and CI failures.
Changes:
- Updates
DESCRIPTION/NAMESPACE/man/to align exports/imports and fix package-load + docs-check issues. - Replaces
serodynamics:::calls with internal implementations (R/utils_internal.R) and updates call sites. - Adds mock datasets, tests, a getting-started vignette/README updates, and GitHub Actions workflows for R CMD check + pkgdown.
Reviewed changes
Copilot reviewed 35 out of 38 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| vignettes/getting-started.Rmd | New vignette introducing package workflows using mock data. |
| tests/testthat/test-utils_internal.R | Adds unit tests for internal helpers (ab, get_timeindays_var). |
| tests/testthat/test-process_shigella_data.R | Adds tests for reshaping/filtering logic. |
| tests/testthat/test-predict_posterior_at_times.R | Adds tests for posterior prediction helper output structure. |
| tests/testthat/test-model_comparison_table.R | Adds tests for comparison-table deltas and percent improvements. |
| tests/testthat/test-compute_residual_metrics.R | Adds tests for residual metrics on original/log scales. |
| tests/testthat.R | Standard testthat entrypoint for running package tests. |
| README.Rmd | Expands README with overview, install, usage, and documentation links. |
| R/utils_internal.R | Adds internal replacements for upstream non-exported functions. |
| R/shigella-package.R | Imports rlang::.data to satisfy NSE/linting patterns. |
| R/process_shigella_data.R | Removes unused column selection and formats roxygen/code for lint. |
| R/predict_posterior_at_times.R | Stops using serodynamics::: and pivots/expands time grid more readably. |
| R/model_comparison_table.R | Adds exported model_comparison_table() for compact comparison summaries. |
| R/fig2_overall_newperson.R | Stops using serodynamics::: and registers global variables for NSE. |
| R/data.R | Adds roxygen docs for included mock datasets. |
| R/compute_residual_metrics.R | Replaces serodynamics::: time-var accessor with internal helper; improves formatting/errors. |
| NAMESPACE | Regenerates exports/imports to match current roxygen output. |
| man/utils_internal.Rd | Documents internal utilities topic. |
| man/process_shigella_data.Rd | New/updated Rd for process_shigella_data(). |
| man/prep_newperson_params.Rd | New/updated Rd for prep_newperson_params(). |
| man/predict_posterior_at_times.Rd | New/updated Rd for posterior prediction helper. |
| man/postprocess_jags_output.Rd | Removes stale Rd for removed export. |
| man/model_comparison_table.Rd | New Rd for model_comparison_table(). |
| man/mock_posterior_draws.Rd | Adds dataset documentation. |
| man/mock_case_data.Rd | Adds dataset documentation. |
| man/make_model_comparison_table.Rd | Adds/updates Rd for model comparison helper. |
| man/fmt_mci.Rd | Adds/updates Rd for formatting helper. |
| man/fig2_overall_newperson.Rd | Adds/updates Rd for plotting function. |
| man/compute_residual_metrics.Rd | Adds/updates Rd for residual metrics function. |
| DESCRIPTION | Updates Imports/Suggests/config for runtime deps + testthat edition. |
| data/mock_posterior_draws.rda | Adds tracked mock posterior draws data. |
| data/mock_case_data.rda | Adds tracked mock case dataset. |
| data/.gitignore | Allows tracking the two mock .rda files while ignoring others. |
| data-raw/mock_data.R | Adds generator script for mock datasets. |
| .Rbuildignore | Ignores dev/data-raw/quarto artifacts in package build. |
| .gitignore | Stops blanket-ignoring data/ so mock .rda can be committed. |
| .github/workflows/R-CMD-check.yaml | Adds R CMD check workflow (release + devel). |
| .github/workflows/pkgdown.yaml | Adds pkgdown build + GitHub Pages deploy workflow. |
Comments suppressed due to low confidence (1)
R/compute_residual_metrics.R:87
time_var/value_varare character scalars (derived from attributes), butrename(t = {{ time_var }}, obs = {{ value_var }})uses{{ }}(curly-curly) which quotes the symboltime_varrather than using its string value. This will attempt to rename columns literally namedtime_var/value_varand will fail for realcase_datainputs (including the mock dataset in tests). Usedplyr::rename(t = dplyr::all_of(time_var), obs = dplyr::all_of(value_var))(or!!rlang::sym(time_var)/!!rlang::sym(value_var)) instead.
time_var <- get_timeindays_var(dataset)
value_var <- serocalculator::get_values_var(dataset)
observed_data <- dataset |>
dplyr::rename(t = {{ time_var }}, obs = {{ value_var }}) |>
dplyr::select(dplyr::all_of(c("id", "t", "obs", "antigen_iso"))) |>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| test_that("ab() returns y0 at t = 0", { | ||
| result <- ab(t = 0, y0 = 200, y1 = 2000, t1 = 10, alpha = 0.02, shape = 1.2) | ||
| expect_equal(result, 200) | ||
| }) | ||
|
|
||
| test_that("ab() returns y1 at t = t1", { | ||
| result <- ab(t = 10, y0 = 200, y1 = 2000, t1 = 10, alpha = 0.02, shape = 1.2) | ||
| expect_equal(result, 2000) | ||
| }) | ||
|
|
||
| test_that("ab() shows expected rise for t < t1", { | ||
| result <- ab(t = 5, y0 = 200, y1 = 2000, t1 = 10, alpha = 0.02, shape = 1.2) | ||
| expected <- 200 * exp((log(2000 / 200) / 10) * 5) | ||
| expect_equal(result, expected) | ||
| }) | ||
|
|
||
| test_that("ab() decays toward zero for large t (shape > 1)", { | ||
| result <- ab(t = 10000, y0 = 200, y1 = 2000, t1 = 10, alpha = 0.02, shape = 1.2) | ||
| expect_true(is.finite(result)) | ||
| expect_true(result >= 0) | ||
| }) | ||
|
|
||
| test_that("ab() handles vector input", { | ||
| times <- c(0, 5, 10, 30, 90) | ||
| result <- ab(t = times, y0 = 200, y1 = 2000, t1 = 10, alpha = 0.02, shape = 1.2) | ||
| expect_length(result, 5) | ||
| expect_true(all(is.finite(result))) | ||
| expect_equal(result[1], 200) | ||
| expect_equal(result[3], 2000) | ||
| }) | ||
|
|
||
| test_that("ab() does not error when t1 = 0", { | ||
| expect_no_error(ab(t = c(0, 10, 30), y0 = 200, y1 = 2000, t1 = 0, alpha = 0.02, shape = 1.2)) | ||
| }) |
There was a problem hiding this comment.
These tests call ab() directly, but ab is an internal (non-exported) function, so it won’t be attached by library(shigella) and the symbol lookup will fail during R CMD check. Access it via getFromNamespace("ab", "shigella") (or shigella:::ab within tests) before calling it.
| test_that("get_timeindays_var() finds time variable from attribute", { | ||
| mock_data <- data.frame(timepoint = c(0, 7, 30), value = c(100, 200, 300)) | ||
| attr(mock_data, "timeindays") <- "timepoint" | ||
| expect_equal(get_timeindays_var(mock_data), "timepoint") | ||
| }) | ||
|
|
||
| test_that("get_timeindays_var() defaults to timeindays when attribute missing", { | ||
| mock_data <- data.frame(timeindays = c(0, 7, 30), value = c(100, 200, 300)) | ||
| expect_equal(get_timeindays_var(mock_data), "timeindays") | ||
| }) |
There was a problem hiding this comment.
get_timeindays_var() is also internal (not exported), so calling it unqualified will fail when only library(shigella) is loaded in tests/testthat.R. Consider retrieving it with getFromNamespace("get_timeindays_var", "shigella") (or shigella:::get_timeindays_var) inside the test before use.
| test_that("predict_posterior_at_times returns expected structure", { | ||
| # Create minimal mock posterior data | ||
| mock_model <- data.frame( | ||
| Subject = rep("test_id", 15), | ||
| Iso_type = rep("IgG", 15), | ||
| Chain = rep(1, 15), | ||
| Iteration = rep(1:3, 5), | ||
| Parameter = rep(c("y0", "y1", "t1", "alpha", "shape"), each = 3), | ||
| value = c( | ||
| 200, 210, 190, # y0 | ||
| 2000, 2100, 1900, # y1 | ||
| 10, 12, 9, # t1 | ||
| 0.02, 0.025, 0.015, # alpha | ||
| 1.0, 1.1, 0.9 # shape | ||
| ) | ||
| ) | ||
|
|
||
| times <- c(0, 30, 90) | ||
|
|
||
| result <- predict_posterior_at_times( | ||
| model = mock_model, | ||
| ids = "test_id", | ||
| antigen_iso = "IgG", | ||
| times = times | ||
| ) | ||
|
|
There was a problem hiding this comment.
These tests call predict_posterior_at_times() directly, but the function is not exported (it’s marked internal and is absent from NAMESPACE), so it won’t be on the search path after library(shigella) and the tests will error. Access it via getFromNamespace("predict_posterior_at_times", "shigella") (or shigella:::predict_posterior_at_times) before invoking it.
| RoxygenNote: 7.3.3 | ||
| Imports: | ||
| cli, | ||
| dplyr, |
There was a problem hiding this comment.
The package uses the .by argument in dplyr::summarise() (e.g., compute_residual_metrics() and fig2_overall_newperson()), which requires dplyr >= 1.1.0. To avoid installation/runtime failures on environments with older dplyr, add a minimum version constraint in Imports (e.g., dplyr (>= 1.1.0)).
| dplyr, | |
| dplyr (>= 1.1.0), |
| testthat (>= 3.0.0), | ||
| tidyverse | ||
| Depends: | ||
| R (>= 3.5) |
There was a problem hiding this comment.
The package code uses the base pipe operator |> throughout R/ (e.g., compute_residual_metrics(), process_shigella_data(), etc.), which requires R >= 4.1 to parse. The Depends: R (>= 3.5) entry is therefore inaccurate and will cause installation failures on R < 4.1. Either bump the minimum R version in DESCRIPTION (e.g., R (>= 4.1)) or replace |> with a pipe supported on older R versions (e.g., %>%).
| R (>= 3.5) | |
| R (>= 4.1) |
… + tests (#11) * Delete R/create_incidence_table.R * Delete R/create_noise_df.R * Delete R/plot_summary_metrics.R * Delete R/simulate_seroincidence.R * Delete R/prepare_df_for_serocalculator.R * Delete R/postprocess_jags_output.R * Delete R/generate_final_table.R * Delete R/create_xs_data.R * Delete R/process_shigella_data.R * Add process_shigella_data function for data reshaping This function filters and reshapes longitudinal Shigella data for serodynamics workflows, standardizing column names and preparing the dataset for conversion. * Add function to summarize antibody trajectories for newperson This function summarizes population-level antibody trajectories for a hypothetical new individual, computing median and credible intervals. It allows customization of various parameters for plotting and data return options. * Add function to predict posterior at specified times This function generates posterior predictions of antibody trajectories at specified time points for selected subjects and antigen/isotype. It processes posterior draws and evaluates the antibody curve using specified parameters. * Add compute_residual_metrics function for antibody data This function computes residuals between observed antibody measurements and posterior median predictions, returning pointwise residuals or aggregated error metrics (MAE, RMSE, SSE) at various summary levels. * Add model comparison function with residual metrics This function computes and compares residual metrics for serotype-specific and overall models, providing insights on their performance differences. * Add fmt_mci function to format median and intervals * Add function to extract and summarize newperson parameters This function processes posterior draws for the 'newperson' subject, filtering and reshaping the data into a wide format suitable for analysis. * Update R/fig2_overall_newperson.R Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update R/prep_newperson_params.R Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update R/model_comparison_table.R Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update R/compute_residual_metrics.R Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update R/process_shigella_data.R Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix package dependencies, namespace exports, and package infrastructure (#12) * Initial plan * Fix DESCRIPTION dependencies and remove ::: usage - Move tibble, tidyr, purrr from Suggests to Imports - Add serocalculator and rlang to Imports - Remove unused cohort_name selection in process_shigella_data - Replace serodynamics::: calls with internal helper functions - Add utils_internal.R with get_timeindays_var() and ab() implementations Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Add package infrastructure: tests, workflows, vignettes, and mock data - Add testthat tests for main functions - Add R CMD check and pkgdown GitHub Actions workflows - Add data-raw/ with mock data generation script - Add R/data.R with mock data documentation - Add getting-started vignette - Update README.Rmd with package overview and usage - Update .Rbuildignore to exclude non-package files Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Fix rlang::rnorm() to rnorm() in mock data generation Use base R rnorm() instead of non-existent rlang::rnorm() Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Add permissions block to R-CMD-check workflow Set explicit GITHUB_TOKEN permissions (contents: read) for security Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Update documentation to remove reference to serodynamics:::ab() Update comment to reflect internal implementation instead of external ::: call Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Align internal utils with serodynamics and update tests Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/d36469e9-e5db-41bb-ad8f-cc452230b453 * Fix namespace export errors and add mock data .rda files Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/1327221c-702c-4c06-907f-1b381d75ecd9 Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Fix failing tests by adding model_comparison_table export and sync roxygen note Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/47d8cc5c-e58f-4f67-a13f-b5f56651a62e Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Fix remaining docs-check and lint CI issues Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/d635bda4-41b7-4feb-8fc3-330a60fec1ac Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Fix compute_residual_metrics indentation at line 137 Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/6af850e8-229a-4ffd-a552-ff9467c5bbbb Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Fix 5 CI failures: version bump, LICENSE, non-ASCII chars, VignetteBuilder, unused Imports, WORDLIST, line lengths Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/be474f7c-718f-491f-84a7-bf1b17ecce18 Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Update man/fmt_mci.Rd to match roxygen docs (devtools::document() sync) Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/a9ff4314-f41a-414a-955e-d0c37e3e3dd8 Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Fix review feedback: rlang::sym rename, t1=0 edge case, shigella::: in tests, TODO comment Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/a030fe7b-7a02-4d32-a346-01e663e62bad Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Restore ab() and bt() to exact upstream implementations; update t1=0 test Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/40bd4f82-f569-4387-98be-3bfec61029b2 Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Update data-raw/mock_data.R Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix roxygen docs: give bt() its own params, move trajectory docs to ab() Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/9c7dfb28-b082-4292-98b7-37fbefb0b36b Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Fix Github -> GitHub capitalization in inst/WORDLIST Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/be13d809-cfdc-485c-889c-92a9d2ebd9c2 Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> * Fix Github -> GitHub capitalization in NEWS.md Agent-Logs-Url: https://github.com/UCD-SERG/shigella/sessions/9263f1b7-8152-4f90-9f85-e2bb428c4798 Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Addresses code review feedback on dependency management and
:::operator usage, and fixes CI package-load failures caused by stale namespace exports and missing mock data objects.Dependency Fixes
tibbleandtidyrto Imports (used by package runtime code)serocalculatorandrlangto Imports (missing declarations)testthat (>= 3.0.0)in Suggests withConfig/testthat/edition: 3purrrback to Suggests after confirming nopurrr::usage inR/*.RReplace ::: with Internal Implementations
Created
R/utils_internal.Rwith internal replacements to avoid non-exported access:get_timeindays_var()ab()These implementations were verified and aligned with
ucdavis/serodynamicssource behavior, and allserodynamics:::calls were removed from:compute_residual_metrics.Rpredict_posterior_at_times.Rfig2_overall_newperson.RCode Cleanup
cohort_nameselection inprocess_shigella_data.Rrlang::rnorm()→rnorm()in mock data generation scriptCI Package-Load Fixes (Namespace/Data)
Resolved shared root cause for
docs-check,test-coverage, andlint-changed-filesfailures:postprocess_jags_outputfromNAMESPACEman/postprocess_jags_output.Rdman/*.Rdfilesdata/mock_posterior_draws.rdadata/mock_case_data.rda.rdafilesPackage Infrastructure
CI/CD:
Tests:
test-compute_residual_metrics.R- validates output structure, metrics sanitytest-predict_posterior_at_times.R- multi-subject predictionstest-process_shigella_data.R- data reshaping, NA handlingtest-model_comparison_table.R- comparison logic, percent improvementstest-utils_internal.R- internal utility coverage (ab(),get_timeindays_var())Documentation:
data-raw/mock_data.R- generates synthetic posterior draws + case dataR/data.R- roxygen docs for mock datasetsvignettes/getting-started.Rmd- package overview, usage examples.Rbuildignoreto exclude simulation scripts and qmd artifactsMock Data Structure:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.