Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposes more LFMCMC methods and updates epiworld #52

Merged
merged 6 commits into from
Nov 25, 2024
Merged

Conversation

gvegayon
Copy link
Member

@gvegayon gvegayon commented Nov 22, 2024

This pull request includes several significant updates to the epiworldR package, focusing on the LFMCMC model, namespace management, and versioning. The changes improve the functionality and robustness of the package, particularly in the handling of the LFMCMC model.

Versioning and Package Information:

  • Updated the package version from 0.4-3 to 0.5-0 in the DESCRIPTION file.
  • Updated the versioning macros in inst/include/epiworld/epiworld.hpp to reflect the new version 0.5.0.

Namespace Management:

  • Removed several S3method entries related to epiworld_lfmcmc from the NAMESPACE file. [1] [2]
  • Added new export entries for functions related to LFMCMC such as get_accepted_params, get_accepted_stats, and others in the NAMESPACE file. [1] [2] [3]

LFMCMC Model Enhancements:

  • Introduced the stopifnot_lfmcmc function to validate LFMCMC objects in R/LFMCMC.R.
  • Refactored several methods in R/LFMCMC.R to include stopifnot_lfmcmc checks, ensuring that the input is a valid LFMCMC object. [1] [2]
  • Added new functions in R/LFMCMC.R to retrieve accepted parameters, statistics, and other related data from the LFMCMC model.
  • Updated the print method in R/LFMCMC.R to include a burnin parameter for discarding initial samples.
  • Expanded test-lfmcmc.R to cover the above enhancements

C++ Backend Adjustments:

  • Updated the LFMCMC class in inst/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp to include new methods for retrieving accepted parameters and statistics.
  • Modified the print method in inst/include/epiworld/math/lfmcmc/lfmcmc-meat-print.hpp to handle the burnin parameter.
  • Adjusted the run method in inst/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp to improve parameter handling and kernel function calls. [1] [2]

Miscellaneous Improvements:

  • Updated template defaults in several header files to use EPI_DEFAULT_TSEQ instead of specific types. [1] [2] [3] [4]
  • Improved error messages in inst/include/epiworld/model-meat.hpp for better clarity.

These changes collectively enhance the usability, reliability, and maintainability of the epiworldR package, particularly in the context of the LFMCMC model.

Copy link
Contributor

@apulsipher apulsipher 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 so far. I'm going to merge in the latest from the C++ library and fix the failing tests

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 86.36364% with 9 lines in your changes missing coverage. Please review.

Project coverage is 36.15%. Comparing base (cc673d1) to head (44a40a7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
R/LFMCMC.R 87.23% 6 Missing ⚠️
src/lfmcmc.cpp 84.21% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   34.82%   36.15%   +1.32%     
==========================================
  Files          36       36              
  Lines        1921     1975      +54     
==========================================
+ Hits          669      714      +45     
- Misses       1252     1261       +9     

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

@apulsipher apulsipher merged commit 174263f into main Nov 25, 2024
14 checks passed
@apulsipher apulsipher deleted the more-funs-lfmcmc branch November 25, 2024 21:48
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.

2 participants