Skip to content

Conversation

gvegayon
Copy link
Member

@gvegayon gvegayon commented Jul 21, 2025

This pull request introduces several updates and improvements to the epiworldR package, focusing on the measles models and developer tooling. The most significant changes are the renaming and deprecation of the ModelMeaslesQuarantine model in favor of ModelMeaslesSchool, enhancements to the ModelMeaslesMixing model interface and documentation, and updates to the underlying C++ code for tracking agent interactions. Additionally, the package version has been incremented and developer environment configurations have been improved.

Model Renaming and Deprecation

  • The ModelMeaslesQuarantine model has been renamed to ModelMeaslesSchool, and the old function is now deprecated with a warning to use the new name instead. All relevant code, documentation, and C++ bindings have been updated to reflect this change. (R/ModelMeaslesSchool.R, NAMESPACE, NEWS.md, R/cpp11.R) [1] [2] [3] [4] [5] [6]

Model Interface and Documentation Improvements

  • The ModelMeaslesMixing R function interface was refactored to remove the vname parameter and provide sensible defaults for key epidemiological parameters, improving usability and clarity. Documentation was updated to match the new interface and provide more accurate information on model behavior. (R/ModelMeaslesMixing.R) [1] [2] [3] [4] [5]
  • The corresponding C++ model constructor was updated to remove the unused virus name parameter, aligning with the R interface changes. (inst/include/epiworld/models/measlesmixing.hpp) [1] [2] [3] [4]

C++ Model Enhancements

  • Added a new vector tracking_matrix_date to ModelMeaslesMixing for more precise tracking of agent interaction dates, and refactored the tracking logic for improved accuracy and efficiency. (inst/include/epiworld/models/measlesmixing.hpp) [1] [2] [3]

Versioning and Release Notes

  • Incremented the C++ library patch version and updated the package version to 0.9.1.0, with corresponding release notes detailing the changes and deprecation. (inst/include/epiworld/epiworld.hpp, NEWS.md) [1] [2]

Developer Tooling and Environment

  • Updated the development Docker image to use R 4.5.1 and improved VSCode devcontainer settings for R development. Also, ensured required tools are installed for GitHub Actions workflows. (.devcontainer/Dockerfile, .devcontainer/.vscode/settings.json, .github/workflows/r.yml) [1] [2] [3]

@gvegayon gvegayon requested a review from Copilot September 7, 2025 19:37
Copy link

@Copilot 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 pull request implements several updates to the epiworldR package, primarily focused on renaming and improving the measles models. The most significant change is renaming ModelMeaslesQuarantine to ModelMeaslesSchool with proper deprecation handling, along with interface improvements to ModelMeaslesMixing and various infrastructure updates.

  • Rename ModelMeaslesQuarantine to ModelMeaslesSchool with deprecation warning
  • Remove vname parameter from ModelMeaslesMixing and provide default values for epidemiological parameters
  • Update C++ tracking implementation for more precise agent interaction monitoring

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/epimodels.cpp Updates C++ function signatures to match model renames and parameter changes
src/cpp11.cpp Updates auto-generated C++ bindings for renamed functions and parameter changes
man/*.Rd Updates documentation cross-references to use new model name
inst/tinytest/test-measlesmixing.R Removes tests for deprecated vname parameter
inst/include/epiworld/models/measlesquarantine.hpp Renames class and functions from ModelMeaslesQuarantine to ModelMeaslesSchool
inst/include/epiworld/models/measlesmixing.hpp Removes vname parameter and improves contact tracking with date information
inst/include/epiworld/epiworld.hpp Increments C++ library patch version
R/cpp11.R Updates R function signatures to match C++ changes
R/ModelMeaslesSchool.R Renames main function and adds deprecation wrapper
R/ModelMeaslesMixing.R Removes vname parameter and adds default values
NEWS.md Documents version update and model name change
NAMESPACE Exports new model name
.github/workflows/r.yml Installs curl for GitHub Actions
.devcontainer/Dockerfile Updates R version to 4.5.1
.devcontainer/.vscode/settings.json Adds VSCode R development settings

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

{"_epiworldR_ModelDiffNet_cpp", (DL_FUNC) &_epiworldR_ModelDiffNet_cpp, 8},
{"_epiworldR_ModelMeaslesMixing_cpp", (DL_FUNC) &_epiworldR_ModelMeaslesMixing_cpp, 21},
{"_epiworldR_ModelMeaslesQuarantine_cpp", (DL_FUNC) &_epiworldR_ModelMeaslesQuarantine_cpp, 16},
{"_epiworldR_ModelMeaslesMixing_cpp", (DL_FUNC) &_epiworldR_ModelMeaslesMixing_cpp, 20},
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The parameter count for ModelMeaslesMixing_cpp should be 20, but the actual function signature shows 21 parameters. This mismatch will cause runtime errors when R tries to call the C++ function.

Suggested change
{"_epiworldR_ModelMeaslesMixing_cpp", (DL_FUNC) &_epiworldR_ModelMeaslesMixing_cpp, 20},
{"_epiworldR_ModelMeaslesMixing_cpp", (DL_FUNC) &_epiworldR_ModelMeaslesMixing_cpp, 21},

Copilot uses AI. Check for mistakes.

isolation_period,
vax_reduction_recovery_rate = .5,
transmission_rate = .9,
contact_rate = 15 / transmission_rate / prodromal_period,
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The default value for contact_rate references prodromal_period, but prodromal_period is defined later in the parameter list (line 125). This will cause an error since R evaluates default values left-to-right and prodromal_period is not yet available.

Copilot uses AI. Check for mistakes.

#'
#' The default value for the contact rate is an approximation to the disease's
#' basic reproduction number (R0), but it is not 100% accurate. A more accurate
#' way to se the contact rate is available, and will be distributed in the
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

Typo in documentation: 'se' should be 'set'.

Suggested change
#' way to se the contact rate is available, and will be distributed in the
#' way to set the contact rate is available, and will be distributed in the

Copilot uses AI. Check for mistakes.

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.

1 participant