Skip to content

Commit

Permalink
test: fix typo in snapshot test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bai-Li-NOAA committed Sep 25, 2024
1 parent 651e6ef commit 35c9838
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/fimsfit.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
i Maximum gradient= 1e-04
i Negative log likelihood (NLL):
* Marginal NLL= 1498.433
* Total NLL= 1498.33
* Total NLL= 1498.433
i Terminal SB= 10000

30 changes: 16 additions & 14 deletions tests/testthat/helper-integration-tests-setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
#' estimation_mode = TRUE
#' )
setup_and_run_FIMS_without_wrappers <- function(iter_id,
om_input_list,
om_output_list,
em_input_list,
estimation_mode = TRUE,
map = list()) {
om_input_list,
om_output_list,
em_input_list,
estimation_mode = TRUE,
map = list()) {
# Load operating model data for the current iteration
om_input <- om_input_list[[iter_id]]
om_output <- om_output_list[[iter_id]]
Expand Down Expand Up @@ -208,7 +208,7 @@ setup_and_run_FIMS_without_wrappers <- function(iter_id,
opt <- NULL
if (estimation_mode == TRUE) {
opt <- stats::nlminb(obj$par, obj$fn, obj$gr,
control = list(eval.max = 800, iter.max = 800)
control = list(eval.max = 800, iter.max = 800)
)
}
# Call report using MLE parameter values, or
Expand Down Expand Up @@ -277,11 +277,11 @@ setup_and_run_FIMS_without_wrappers <- function(iter_id,
#' estimation_mode = TRUE
#' )
setup_and_run_FIMS_with_wrappers <- function(iter_id,
om_input_list,
om_output_list,
em_input_list,
estimation_mode = TRUE,
map = list()) {
om_input_list,
om_output_list,
em_input_list,
estimation_mode = TRUE,
map = list()) {
# Load operating model data for the current iteration
om_input <- om_input_list[[iter_id]]
om_output <- om_output_list[[iter_id]]
Expand Down Expand Up @@ -435,7 +435,7 @@ setup_and_run_FIMS_with_wrappers <- function(iter_id,
parameters <- list(p = get_fixed())
input <- list()
input$parameters <- parameters
input$version = "Model Comparison Project example"
input$version <- "Model Comparison Project example"
fit <- fit_fims(input, do.fit = estimation_mode)

clear()
Expand All @@ -445,7 +445,9 @@ setup_and_run_FIMS_with_wrappers <- function(iter_id,
obj = fit$obj,
opt = fit$opt,
report = fit$rep,
sdr_report = fit$sd
sdr_report = fit$sd,
fit = fit
))
}


}
4 changes: 2 additions & 2 deletions tests/testthat/test-fimsfit.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ test_that("print.fimsfit prints summary correctly", {
max_gradient = 0.0001,
objective = 1498.433),
rep = list(ssb = list(rep(10000, 5)),
jnll = 1498.33),
jnll = 1498.433),
parList = list()
)
)
class(fit_obj) <- c("fimsfit", "list")

expect_snapshot(
Expand Down

0 comments on commit 35c9838

Please sign in to comment.