From cf2a8977ef2ec7dc1bcc2315f8d6779f89eedf1f Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Tue, 28 Jan 2025 11:42:09 -0700 Subject: [PATCH 1/8] Update DESCRIPTION with minimum version of R --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index d0ae353..0e5393d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,6 +2,7 @@ Package: epiworldR Type: Package Title: Fast Agent-Based Epi Models Version: 0.6.0.0 +Depends: R (>= 4.1.0) Authors@R: c( person(given="George", family="Vega Yon", role=c("aut"), email="g.vegayon@gmail.com", comment = c(ORCID = "0000-0002-3171-0844")), From 80b16e1e67cf8c47b0f2be8e875e4867e392b860 Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Tue, 28 Jan 2025 11:44:02 -0700 Subject: [PATCH 2/8] Update with latest from C++ library --- inst/include/epiworld/epiworld.hpp | 2 +- .../math/lfmcmc/lfmcmc-meat-print.hpp | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/inst/include/epiworld/epiworld.hpp b/inst/include/epiworld/epiworld.hpp index 6483465..52e4c14 100644 --- a/inst/include/epiworld/epiworld.hpp +++ b/inst/include/epiworld/epiworld.hpp @@ -19,7 +19,7 @@ /* Versioning */ #define EPIWORLD_VERSION_MAJOR 0 #define EPIWORLD_VERSION_MINOR 6 -#define EPIWORLD_VERSION_PATCH 0 +#define EPIWORLD_VERSION_PATCH 1 static const int epiworld_version_major = EPIWORLD_VERSION_MAJOR; static const int epiworld_version_minor = EPIWORLD_VERSION_MINOR; diff --git a/inst/include/epiworld/math/lfmcmc/lfmcmc-meat-print.hpp b/inst/include/epiworld/math/lfmcmc/lfmcmc-meat-print.hpp index 6a658ab..c526a6c 100755 --- a/inst/include/epiworld/math/lfmcmc/lfmcmc-meat-print.hpp +++ b/inst/include/epiworld/math/lfmcmc/lfmcmc-meat-print.hpp @@ -93,7 +93,16 @@ inline void LFMCMC::print(size_t burnin) const for (auto & n : summ_params) { - int tmp_nchar = std::floor(std::log10(std::abs(n))); + int tmp_nchar; + + if (std::abs(n) < 1) { + // std::log10(<1) will return negative number + // std::log10(0) will return -inf and throw a runtime error + tmp_nchar = 0; + } else { + tmp_nchar = std::floor(std::log10(std::abs(n))); + } + if (nchar_par_num < tmp_nchar) nchar_par_num = tmp_nchar; } @@ -161,7 +170,15 @@ inline void LFMCMC::print(size_t burnin) const int nchar = 0; for (auto & s : summ_stats) { - int tmp_nchar = std::floor(std::log10(std::abs(s))); + int tmp_nchar; + if (std::abs(s) < 1) { + // std::log10(<1) will return negative number + // std::log10(0) will return -inf and throw a runtime error + tmp_nchar = 0; + } else { + tmp_nchar = std::floor(std::log10(std::abs(s))); + } + if (nchar < tmp_nchar) nchar = tmp_nchar; } From 40953bc2e27083618beb756e380f02a9c9e4a3ef Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Tue, 28 Jan 2025 11:47:05 -0700 Subject: [PATCH 3/8] Bump version number --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0e5393d..1103232 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: epiworldR Type: Package Title: Fast Agent-Based Epi Models -Version: 0.6.0.0 +Version: 0.6.1.0 Depends: R (>= 4.1.0) Authors@R: c( person(given="George", family="Vega Yon", role=c("aut"), From 24806f1848fb8ea92eac4095f135234fdd82ded7 Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Tue, 28 Jan 2025 12:17:29 -0700 Subject: [PATCH 4/8] Update NEWS.md --- NEWS.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 422dd9f..d256b87 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,10 @@ -# epiworldR 0.6.0.0 +# epiworldR 0.6.1.0 + +* Updates to reflect changes in the `epiworld` C++ library (mostly bug fixes) -## New features +* Package now requires R version >=4.1.0, because it uses the pipe `|>` + +# epiworldR 0.6.0.0 * The package now includes the `LFMCMC` module that implements the likelihood-free Markov Chain Monte Carlo algorithm. This @@ -15,8 +19,6 @@ * The function `today()` returns the current day (step) of the simulation. -## Misc - * We changed the versioning system. To allow the R package to increase version number while preserving epiworld (C++) versioning, we added a fourth number that indicates R-only patches (similar to RcppArmadillo). From 16dbd0e65ecd9b47ca75a8a30ac9bedd37a901b1 Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Tue, 28 Jan 2025 12:18:16 -0700 Subject: [PATCH 5/8] Update NEWS.md --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index d256b87..65fd86a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ * Package now requires R version >=4.1.0, because it uses the pipe `|>` + # epiworldR 0.6.0.0 * The package now includes the `LFMCMC` module that implements From 3e8e39850ef62d20106462622df0a32f3bc4b5a5 Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Tue, 28 Jan 2025 12:32:49 -0700 Subject: [PATCH 6/8] Update CITATION --- inst/CITATION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/CITATION b/inst/CITATION index 8630f21..63dba0b 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,4 +1,4 @@ -year <- 2024 +year <- 2025 note <- sprintf("R package version %s", meta$Version) bibentry( From 0a9eaab310f3a14fa220d6589cb1b776af5c8c26 Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Tue, 28 Jan 2025 15:08:06 -0700 Subject: [PATCH 7/8] Update GHA to use macOS 13 --- .github/workflows/r.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index bf69e22..869e76f 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -28,12 +28,12 @@ jobs: config: - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'release'} - - {os: macOS-latest, r: 'devel', http-user-agent: 'release'} + - {os: macOS-13, r: 'devel', http-user-agent: 'release'} - {os: windows-latest, r: 'devel', http-user-agent: 'release'} # se older ubuntu to maximise backward compatibility - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -65,7 +65,7 @@ jobs: error-on: '"warning"' - uses: r-lib/actions/check-r-package@v2 - if: ${{ matrix.config.os != 'ubuntu-latest' || matrix.config.r != 're;ease' }} + if: ${{ matrix.config.os != 'ubuntu-latest' || matrix.config.r != 'release' }} with: upload-snapshots: false upload-results: false From de2d0fc59de4237eadb0ef895041c00e326491a0 Mon Sep 17 00:00:00 2001 From: Andrew Pulsipher Date: Tue, 28 Jan 2025 15:21:53 -0700 Subject: [PATCH 8/8] Revert to macos latest --- .github/workflows/r.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 869e76f..d47af70 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -28,7 +28,7 @@ jobs: config: - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'release'} - - {os: macOS-13, r: 'devel', http-user-agent: 'release'} + - {os: macOS-latest, r: 'devel', http-user-agent: 'release'} - {os: windows-latest, r: 'devel', http-user-agent: 'release'} # se older ubuntu to maximise backward compatibility - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}