Skip to content

Commit

Permalink
Fix R CMD check and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Oct 11, 2023
1 parent 3e775ad commit 08325b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions R/mesh.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ make_mesh <- function(data, xy_cols,
loc_centers <- NA
}
# TODO:
spde <- INLA::inla.spde2.matern(mesh)
# spde <- INLA::inla.spde2.matern(mesh)
# mesh_inla <- INLA::inla.mesh.create(loc_xy, refine = TRUE, cutoff = cutoff)
# names(spde_inla$param.inla)

# spde <- fmesher::fm_matern_precision(mesh, alpha = 2)
spde <- fmesher::fm_matern_precision(mesh, alpha = 2)
# A_inla <- INLA::inla.spde.make.A(mesh, loc = loc_xy)
A <- fmesher::fm_basis(mesh, loc = loc_xy)

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-3-spatial-varying.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test_that("Delta model with spatially varying factor predictor and no spatiotemp
spatial = "off", # since spatially varying predictor is a factor
spatial_varying = ~0 + quarter,
time = "year",
control = sdmTMBcontrol(newton_loops = 0L)
control = sdmTMBcontrol(newton_loops = 1L)
)
expect_s3_class(m, "sdmTMB")
expect_true(sum(is.na(m$sd_report$sd)) == 0L)
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-cross-validation.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ test_that("Cross validation with offsets works", {
d <- pcod_2011
d$log_effort <- rnorm(nrow(d))

library(future)
future::plan(future::multisession)
# library(future)
# future::plan(future::multisession)

expect_error(
fit_cv_off1 <- sdmTMB_cv(
Expand Down Expand Up @@ -213,7 +213,7 @@ test_that("Cross validation with offsets works", {
expect_equal(round(fit_cv_off5$models[[1]]$model$par, 4), round(fit_cv_off7$models[[1]]$model$par, 4))
expect_equal(round(fit_cv_off5$models[[1]]$model$par, 4), round(fit_cv_off8$models[[1]]$model$par, 4))

future::plan(future::sequential)
# future::plan(future::sequential)
})

test_that("Delta model cross validation works", {
Expand Down

0 comments on commit 08325b4

Please sign in to comment.