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

Fix tests with v2.34.1 #910

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tests/testthat/test-model-laplace.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ test_that("laplace() runs when all arguments specified validly", {
expect_equal(fit1$mode()$metadata()$jacobian, as.integer(ok_arg_values$jacobian))
expect_equal(fit1$mode()$metadata()$init_alpha, ok_arg_values$opt_args$init_alpha)

# https://github.com/stan-dev/cmdstan/issues/1242
#expect_equal(fit1$mode()$metadata()$tol_obj, ok_arg_values$opt_args$tol_obj, tolerance = 0)
expect_equal(fit1$mode()$metadata()$tol_obj, ok_arg_values$opt_args$tol_obj, tolerance = 0)

# leaving all at default (except 'data')
expect_laplace_output(fit2 <- mod$laplace(data = data_list, seed = 123))
Expand Down
14 changes: 6 additions & 8 deletions tests/testthat/test-model-optimize.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ test_that("optimize() works with (L-)BFGS tolerances specified", {
# using values that aren't the defaults
init_alpha = 0.002,
tol_obj = 2e-11,
tol_rel_obj = 10001,
tol_rel_obj = 1000,
tol_grad = 5e-07,
tol_rel_grad = 10000001,
tol_rel_grad = 1000000,
tol_param = 5e-07,
history_size = 6,
seed = 123
Expand All @@ -128,12 +128,10 @@ test_that("optimize() works with (L-)BFGS tolerances specified", {
metadata <- fit$metadata()
expect_equal(metadata$init_alpha, 0.002)
expect_equal(metadata$tol_obj, 2e-11)
expect_equal(metadata$tol_rel_obj, 10001)
# https://github.com/stan-dev/cmdstan/issues/1242
# expect_equal(metadata$tol_grad, 5e-07)
expect_equal(metadata$tol_rel_grad, 10000001)
# https://github.com/stan-dev/cmdstan/issues/1242
# expect_equal(metadata$tol_param, 5e-07)
expect_equal(metadata$tol_rel_obj, 1000)
expect_equal(metadata$tol_grad, 5e-07)
expect_equal(metadata$tol_rel_grad, 1000000)
expect_equal(metadata$tol_param, 5e-07)
expect_equal(metadata$history_size, 6)
})

Expand Down
Loading