diff --git a/.Rprofile b/.Rprofile deleted file mode 100644 index 0f860de..0000000 --- a/.Rprofile +++ /dev/null @@ -1,2 +0,0 @@ -library(roxygen2) -library(devtools) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index f36e31f..e2f46c8 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -8,27 +8,16 @@ name: R-CMD-check jobs: R-CMD-check: - runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} (R ${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: macos-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'devel'} + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v2 with: - r-version: ${{ matrix.config.r }} - use-public-rspm: true + r-version: 'release' - uses: r-lib/actions/setup-r-dependencies@v2 with: @@ -37,4 +26,5 @@ jobs: - uses: r-lib/actions/check-r-package@v2 with: + args: 'c("--no-manual", "--as-cran")' upload-snapshots: true diff --git a/.gitignore b/.gitignore index ee875fc..b4aaf6d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,7 @@ tests/testthat/_snaps/ # devtools / roxygen /doc/ /Meta/ + +# local R session config (machine-specific) +.Rprofile +.Renviron diff --git a/DESCRIPTION b/DESCRIPTION index 45826ab..ed8a611 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,5 +19,3 @@ Imports: parallel Suggests: testthat (>= 3.0.0) -Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.2 diff --git a/tests/testthat/test-optim_SQGDE.R b/tests/testthat/test-optim_SQGDE.R index a2dce99..a7228b8 100644 --- a/tests/testthat/test-optim_SQGDE.R +++ b/tests/testthat/test-optim_SQGDE.R @@ -5,7 +5,8 @@ library(graDiEnt) test_that("MLE factorizable MVN recovers sample means", { set.seed(42) true_mu <- c(-1, 1, 0, 2) - data <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1), nrow = 500, ncol = 4) + data <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1), + nrow = 500, ncol = 4 ,byrow = TRUE) analytic_mu <- colMeans(data) neg_log_lik <- function(x, data) { @@ -44,7 +45,7 @@ test_that("MLE factorizable MVN recovers sample means", { test_that("univariate objective recovers sample mean", { set.seed(42) - obs <- rnorm(300, mean = 2.5, sd = 1) + obs <- rnorm(300, mean = 4, sd = 1) analytic_mu <- mean(obs) neg_log_lik_1d <- function(x, obs) { @@ -59,9 +60,9 @@ test_that("univariate objective recovers sample mean", { n_params = 1, n_iter = 500, n_particles = 6, - n_diff = 1, + n_diff = 2, init_center = 0, - init_sd = 2 + init_sd = 1 ), obs = obs ) @@ -155,8 +156,9 @@ test_that("PSOCK parallel execution returns valid solution", { skip_on_cran() set.seed(42) - true_mu <- c(-1, 1, 0, 2) - data_par <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1), nrow = 500, ncol = 4) + true_mu <- c(-1, 8, 0, 2) + data_par <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1), + nrow = 500, ncol = 4 ,byrow = TRUE) analytic_mu <- colMeans(data_par) neg_log_lik <- function(x, data_par) { @@ -201,7 +203,8 @@ test_that("FORK parallel execution returns valid solution", { set.seed(42) true_mu <- c(-1, 1, 0, 2) - data_par <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1), nrow = 500, ncol = 4) + data_par <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1), + nrow = 500, ncol = 4 ,byrow = TRUE) analytic_mu <- colMeans(data_par) neg_log_lik <- function(x, data_par) {