CRAN Package Check Results for Package missSBM

Last updated on 2026-10-21 07:54:46 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.1.0 80.98 341.84 422.82 OK
r-devel-linux-x86_64-debian-gcc 1.1.0 59.05 240.46 299.51 OK
r-devel-linux-x86_64-fedora-clang 1.1.0 57.00 247.35 304.35 OK
r-devel-linux-x86_64-fedora-gcc 1.1.0 64.00 237.71 301.71 OK
r-devel-windows-x86_64 1.1.0 91.00 420.00 511.00 OK
r-patched-linux-x86_64 1.1.0 85.58 342.08 427.66 OK
r-release-linux-x86_64 1.1.0 86.79 329.37 416.16 OK
r-release-macos-arm64 1.1.0 17.00 92.00 109.00 OK
r-release-macos-x86_64 1.1.0 59.00 456.00 515.00 OK
r-release-windows-x86_64 1.1.0 93.00 345.00 438.00 OK
r-oldrel-macos-arm64 1.1.0 20.00 91.00 111.00 ERROR
r-oldrel-macos-x86_64 1.1.0 59.00 679.00 738.00 OK
r-oldrel-windows-x86_64 1.1.0 121.00 474.00 595.00 OK

Check Details

Version: 1.1.0
Check: tests
Result: ERROR Running ‘spelling.R’ [0s/0s] Running ‘testthat.R’ [40s/33s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library(missSBM) > > test_check("missSBM") Adjusting Variational EM for Stochastic Block Model Dyads are distributed according to a 'undirected' SBM. Imputation assumes a 'covar-dyad' network-sampling process iteration #: 2 iteration #: 3 Adjusting Variational EM for Stochastic Block Model Dyads are distributed according to a 'undirected' SBM. Imputation assumes a 'dyad' network-sampling process iteration #: 2 iteration #: 3 Adjusting Variational EM for Stochastic Block Model Dyads are distributed according to a 'undirected' SBM. Imputation assumes a 'covar-node' network-sampling process iteration #: 2 iteration #: 3 iteration #: 4 iteration #: 5 Adjusting Variational EM for Stochastic Block Model Dyads are distributed according to a 'undirected' SBM. Imputation assumes a 'node' network-sampling process iteration #: 2 iteration #: 3 iteration #: 4 Tested sampling: - dyad - node - double-standard - block-node - block-dyad Adjusting Variational EM for Stochastic Block Model Imputation assumes a 'dyad' network-sampling process Initialization of 3 model(s). Tested sampling: - dyad - node - double-standard - block-node - block-dyad - degreeTested sampling: - dyad - node - double-standard - block-node - block-dyad - degree sampling: dyad new better on connectivity node double-standard block-node new better on mixture Adjusting Variational EM for Stochastic Block Model iteration #: 2 iteration #: 3 iteration #: 4 iteration #: 5 iteration #: 6 iteration #: 7 iteration #: 8 iteration #: 9 iteration #: 10 iteration #: 11 iteration #: 12 iteration #: 13 iteration #: 14 iteration #: 15 iteration #: 16 iteration #: 17 iteration #: 18 iteration #: 19 iteration #: 20 iteration #: 21 iteration #: 22 iteration #: 23 iteration #: 24 iteration #: 25 iteration #: 26 iteration #: 27 iteration #: 28 iteration #: 29 iteration #: 30 iteration #: 31 iteration #: 32 iteration #: 33 iteration #: 34 Adjusting Variational EM for Stochastic Block Model Dyads are distributed according to a 'undirected' SBM. Imputation assumes a 'node' network-sampling process iteration #: 2 iteration #: 3 iteration #: 4 iteration #: 5 iteration #: 6 iteration #: 7 iteration #: 8 iteration #: 9 iteration #: 10 iteration #: 11 iteration #: 12 iteration #: 13 iteration #: 14 iteration #: 15 iteration #: 16 iteration #: 17 iteration #: 18 iteration #: 19 iteration #: 20 iteration #: 21 iteration #: 22 iteration #: 23 iteration #: 24 iteration #: 25 iteration #: 26 iteration #: 27 iteration #: 28 iteration #: 29 iteration #: 30 iteration #: 31 iteration #: 32 iteration #: 33 iteration #: 34 Adjusting Variational EM for Stochastic Block Model Imputation assumes a 'node' network-sampling process Initialization of 1 model(s). Performing VEM inference Model with 3 blocks. Adjusting Variational EM for Stochastic Block Model Imputation assumes a 'dyad' network-sampling process Initialization of 2 model(s). Performing VEM inference Model with 2 blocks. Model with 1 blocks. Polishing (node-swap) Looking for better solutions Pass 1 Going forward + Pass 1 Going backward + *** caught segfault *** address 0x110, cause 'invalid permissions' *** caught segfault *** address 0x110, cause 'invalid permissions' Traceback: 1: dispatcher(membership_name, membership_init$to_cc(), model_name, .self$network_to_cc(), TRUE) 2: FUN(X[[i]], ...) 3: lapply(X = S, FUN = FUN, ...) 4: doTryCatch(return(expr), name, parentenv, handler) 5: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 6: tryCatchList(expr, classes, parentenv, handlers) 7: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call, nlines = 1L) prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))}) 8: try(lapply(X = S, FUN = FUN, ...), silent = TRUE) 9: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE)) 10: FUN(X[[i]], ...) 11: lapply(seq_len(cores), inner.do) 12: parallel::mclapply(X, FUN, ..., mc.cores = mc.cores, mc.set.seed = FALSE, mc.silent = TRUE) 13: parallel_lapply(inits, .self$do_one_estim, mc.cores = ncores, verbose = (verbosity > 4)) 14: .self$do_with_inits(inits, Q, reinitialization_effort) 15: .self$estim_ascend(reinitialization_effort, changing_effort) 16: private$BMobject$estimate() 17: mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) 18: eval(code, test_env) 19: eval(code, test_env) 20: withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt) 21: doTryCatch(return(expr), name, parentenv, handler) 22: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 23: tryCatchList(expr, classes, parentenv, handlers) 24: tryCatch(withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal) 25: doWithOneRestart(return(expr), restart) 26: withOneRestart(expr, restarts[[1L]]) 27: withRestarts(tryCatch(withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal), end_test = function() { }) 28: test_code(code, parent.frame()) 29: test_that("SimpleSBM_fit 'Bernoulli' model, undirected, one covariate", { sampler_undirected_cov$rNetwork(store = TRUE) mySBM_sbm <- sbm::SimpleSBM_fit$new(sampler_undirected_cov$networkData, "bernoulli", FALSE, covarList = covarList_undirected) mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) Traceback: mySBM_sbm$setModel(Q) 1: net <- missSBM:::partlyObservedNetwork$new(sampler_undirected_cov$networkData, dispatcher(membership_name, membership_init$to_cc(), model_name, covariates = covarList_undirected) .self$network_to_cc(), TRUE) cls <- net$clustering(1:(2 * Q)) cl <- cls[[Q]] mySBM_missSBM <- missSBM:::SimpleSBM_fit_withCov$new(net, 2: clusterInit = cl, covarList = covarList_undirected)FUN(X[[i]], ...) mySBM_missSBM$doVEM() expect_lt(rmse(mySBM_missSBM$connectParam$mean, mySBM_sbm$connectParam$mean), 3: 0.05)lapply(X = S, FUN = FUN, ...) expect_gt(ARI(mySBM_missSBM$memberships, mySBM_sbm$memberships), 4: 0.8)doTryCatch(return(expr), name, parentenv, handler) expect_lt(rmse(mySBM_missSBM$loglik, mySBM_sbm$loglik), 0.01) 5: expect_lt(rmse(mySBM_missSBM$connectParam$mean, sampler_undirected_cov$connectParam$mean), tryCatchOne(expr, names, parentenv, handlers[[1L]]) 0.1) expect_lt(rmse(mySBM_missSBM$covarParam, sampler_undirected_cov$covarParam), 0.1) 6: expect_gt(ARI(mySBM_missSBM$memberships, sampler_undirected_cov$memberships), tryCatchList(expr, classes, parentenv, handlers) 0.85) }) 7: tryCatch(expr, error = function(e) {30: call <- conditionCall(e)eval(code, test_env) if (!is.null(call)) {31: eval(code, test_env) if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L)32: dcall <- deparse(call, nlines = 1L)withCallingHandlers({ prefix <- paste("Error in", dcall, ": ") eval(code, test_env) LONG <- 75L new_expectations <- the$test_expectations > starting_expectations sm <- strsplit(conditionMessage(e), "\n")[[1L]] if (snapshot_skipped) { w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") skip("On CRAN") if (is.na(w)) } else if (!new_expectations && skip_on_empty) { w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], skip_empty() type = "b") } if (w > LONG) }, expectation = handle_expectation, packageNotFoundError = function(e) { prefix <- paste0(prefix, "\n ") if (on_cran()) { } skip(paste0("{", e$package, "} is not installed.")) else prefix <- "Error : " } msg <- paste0(prefix, conditionMessage(e), "\n")}, snapshot_on_cran = function(cnd) { .Internal(seterrmessage(msg[1L])) snapshot_skipped <<- TRUE if (!silent && isTRUE(getOption("show.error.messages"))) { invokeRestart("muffle_cran_snapshot") cat(msg, file = outFile)}, skip = handle_skip, warning = handle_warning, message = handle_message, .Internal(printDeferredWarnings()) error = handle_error, interrupt = handle_interrupt) } invisible(structure(msg, class = "try-error", condition = e))33: })doTryCatch(return(expr), name, parentenv, handler) 8: 34: try(lapply(X = S, FUN = FUN, ...), silent = TRUE)tryCatchOne(expr, names, parentenv, handlers[[1L]]) 9: 35: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))tryCatchList(expr, classes, parentenv, handlers) 10: 36: FUN(X[[i]], ...)tryCatch(withCallingHandlers({ eval(code, test_env)11: new_expectations <- the$test_expectations > starting_expectationslapply(seq_len(cores), inner.do) if (snapshot_skipped) { skip("On CRAN")12: }parallel::mclapply(X, FUN, ..., mc.cores = mc.cores, mc.set.seed = FALSE, else if (!new_expectations && skip_on_empty) { mc.silent = TRUE) skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) {13: if (on_cran()) {parallel_lapply(inits, .self$do_one_estim, mc.cores = ncores, skip(paste0("{", e$package, "} is not installed.")) verbose = (verbosity > 4)) } }, snapshot_on_cran = function(cnd) {14: snapshot_skipped <<- TRUE.self$do_with_inits(inits, Q, reinitialization_effort) invokeRestart("muffle_cran_snapshot") }, skip = handle_skip, warning = handle_warning, message = handle_message, 15: .self$estim_ascend(reinitialization_effort, changing_effort) error = handle_error, interrupt = handle_interrupt), error = handle_fatal) 16: 37: private$BMobject$estimate()doWithOneRestart(return(expr), restart) 17: 38: mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE))withOneRestart(expr, restarts[[1L]]) 18: eval(code, test_env) 39: 19: withRestarts(tryCatch(withCallingHandlers({ eval(code, test_env)eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) {20: skip("On CRAN")withCallingHandlers({ } eval(code, test_env) else if (!new_expectations && skip_on_empty) { skip_empty() new_expectations <- the$test_expectations > starting_expectations } if (snapshot_skipped) {}, expectation = handle_expectation, packageNotFoundError = function(e) { skip("On CRAN") if (on_cran()) { } skip(paste0("{", e$package, "} is not installed.")) else if (!new_expectations && skip_on_empty) { } skip_empty()}, snapshot_on_cran = function(cnd) { } snapshot_skipped <<- TRUE}, expectation = handle_expectation, packageNotFoundError = function(e) { invokeRestart("muffle_cran_snapshot") if (on_cran()) { skip(paste0("{", e$package, "} is not installed."))}, skip = handle_skip, warning = handle_warning, message = handle_message, } error = handle_error, interrupt = handle_interrupt), error = handle_fatal), }, snapshot_on_cran = function(cnd) { end_test = function() { snapshot_skipped <<- TRUE }) invokeRestart("muffle_cran_snapshot") }, skip = handle_skip, warning = handle_warning, message = handle_message, 40: error = handle_error, interrupt = handle_interrupt)test_code(code = exprs, env = env, reporter = get_reporter() %||% StopReporter$new())21: doTryCatch(return(expr), name, parentenv, handler)41: source_file(path, env = env(env), desc = desc, shuffle = shuffle, error_call = error_call)22: tryCatchOne(expr, names, parentenv, handlers[[1L]])42: FUN(X[[i]], ...)23: tryCatchList(expr, classes, parentenv, handlers)43: lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, 24: error_call = error_call)tryCatch(withCallingHandlers({ eval(code, test_env)44: new_expectations <- the$test_expectations > starting_expectationsdoTryCatch(return(expr), name, parentenv, handler) if (snapshot_skipped) { skip("On CRAN")45: }tryCatchOne(expr, names, parentenv, handlers[[1L]]) else if (!new_expectations && skip_on_empty) { skip_empty()46: }tryCatchList(expr, classes, parentenv, handlers)}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) {47: skip(paste0("{", e$package, "} is not installed."))tryCatch(code, testthat_abort_reporter = function(cnd) { } cat(conditionMessage(cnd), "\n")}, snapshot_on_cran = function(cnd) { NULL snapshot_skipped <<- TRUE}) invokeRestart("muffle_cran_snapshot") }, skip = handle_skip, warning = handle_warning, message = handle_message, 48: error = handle_error, interrupt = handle_interrupt), error = handle_fatal)with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call))25: doWithOneRestart(return(expr), restart)49: test_files_serial(test_dir = test_dir, test_package = test_package, 26: test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, withOneRestart(expr, restarts[[1L]]) env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, desc = desc, load_package = load_package, shuffle = shuffle, 27: error_call = error_call)withRestarts(tryCatch(withCallingHandlers({ eval(code, test_env)50: new_expectations <- the$test_expectations > starting_expectationstest_files(test_dir = path, test_paths = test_paths, test_package = package, if (snapshot_skipped) { reporter = reporter, load_helpers = load_helpers, env = env, skip("On CRAN") stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, } load_package = load_package, parallel = parallel, shuffle = shuffle) else if (!new_expectations && skip_on_empty) { skip_empty()51: }test_dir("testthat", package = package, reporter = reporter, }, expectation = handle_expectation, packageNotFoundError = function(e) { ..., load_package = "installed") if (on_cran()) { skip(paste0("{", e$package, "} is not installed."))52: }test_check("missSBM")}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUEAn irrecoverable exception occurred. R is aborting now ... invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal), end_test = function() { }) 28: test_code(code, parent.frame()) 29: test_that("SimpleSBM_fit 'Bernoulli' model, undirected, one covariate", { sampler_undirected_cov$rNetwork(store = TRUE) mySBM_sbm <- sbm::SimpleSBM_fit$new(sampler_undirected_cov$networkData, "bernoulli", FALSE, covarList = covarList_undirected) mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) mySBM_sbm$setModel(Q) net <- missSBM:::partlyObservedNetwork$new(sampler_undirected_cov$networkData, covariates = covarList_undirected) cls <- net$clustering(1:(2 * Q)) cl <- cls[[Q]] mySBM_missSBM <- missSBM:::SimpleSBM_fit_withCov$new(net, clusterInit = cl, covarList = covarList_undirected) mySBM_missSBM$doVEM() expect_lt(rmse(mySBM_missSBM$connectParam$mean, mySBM_sbm$connectParam$mean), 0.05) expect_gt(ARI(mySBM_missSBM$memberships, mySBM_sbm$memberships), 0.8) expect_lt(rmse(mySBM_missSBM$loglik, mySBM_sbm$loglik), 0.01) expect_lt(rmse(mySBM_missSBM$connectParam$mean, sampler_undirected_cov$connectParam$mean), 0.1) expect_lt(rmse(mySBM_missSBM$covarParam, sampler_undirected_cov$covarParam), 0.1) expect_gt(ARI(mySBM_missSBM$memberships, sampler_undirected_cov$memberships), 0.85) }) 30: eval(code, test_env) 31: eval(code, test_env) 32: withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt) 33: doTryCatch(return(expr), name, parentenv, handler) 34: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 35: tryCatchList(expr, classes, parentenv, handlers) 36: tryCatch(withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal) 37: doWithOneRestart(return(expr), restart) 38: withOneRestart(expr, restarts[[1L]]) 39: withRestarts(tryCatch(withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal), end_test = function() { }) 40: test_code(code = exprs, env = env, reporter = get_reporter() %||% StopReporter$new()) 41: source_file(path, env = env(env), desc = desc, shuffle = shuffle, error_call = error_call) 42: FUN(X[[i]], ...) 43: lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call) 44: doTryCatch(return(expr), name, parentenv, handler) 45: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 46: tryCatchList(expr, classes, parentenv, handlers) 47: tryCatch(code, testthat_abort_reporter = function(cnd) { cat(conditionMessage(cnd), "\n") NULL}) 48: with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call)) 49: test_files_serial(test_dir = test_dir, test_package = test_package, test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, desc = desc, load_package = load_package, shuffle = shuffle, error_call = error_call) 50: test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, load_package = load_package, parallel = parallel, shuffle = shuffle) 51: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed") 52: test_check("missSBM") An irrecoverable exception occurred. R is aborting now ... Saving _problems/test-sbm-bernoulli-with-covariates-16.R *** caught segfault *** address 0x110, cause 'invalid permissions' *** caught segfault *** address 0x110, cause 'invalid permissions' Traceback: 1: dispatcher(membership_name, membership_init$to_cc(), model_name, .self$network_to_cc(), TRUE) 2: FUN(X[[i]], ...) 3: lapply(X = S, FUN = FUN, ...) 4: doTryCatch(return(expr), name, parentenv, handler) 5: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 6: tryCatchList(expr, classes, parentenv, handlers) 7: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call, nlines = 1L) prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))}) 8: try(lapply(X = S, FUN = FUN, ...), silent = TRUE) 9: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE)) 10: FUN(X[[i]], ...) 11: lapply(seq_len(cores), inner.do) 12: parallel::mclapply(X, FUN, ..., mc.cores = mc.cores, mc.set.seed = FALSE, mc.silent = TRUE) 13: parallel_lapply(inits, .self$do_one_estim, mc.cores = ncores, verbose = (verbosity > 4)) 14: .self$do_with_inits(inits, Q, reinitialization_effort) 15: .self$estim_ascend(reinitialization_effort, changing_effort) 16: private$BMobject$estimate() 17: mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) 18: eval(code, test_env) 19: eval(code, test_env) 20: withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt) 21: doTryCatch(return(expr), name, parentenv, handler) 22: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 23: tryCatchList(expr, classes, parentenv, handlers) 24: tryCatch(withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { Traceback: skip_empty() 1: }dispatcher(membership_name, membership_init$to_cc(), model_name, }, expectation = handle_expectation, packageNotFoundError = function(e) { .self$network_to_cc(), TRUE) if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) 2: }FUN(X[[i]], ...)}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE 3: lapply(X = S, FUN = FUN, ...) invokeRestart("muffle_cran_snapshot") }, skip = handle_skip, warning = handle_warning, message = handle_message, 4: error = handle_error, interrupt = handle_interrupt), error = handle_fatal)doTryCatch(return(expr), name, parentenv, handler) 25: 5: doWithOneRestart(return(expr), restart)tryCatchOne(expr, names, parentenv, handlers[[1L]]) 26: 6: withOneRestart(expr, restarts[[1L]])tryCatchList(expr, classes, parentenv, handlers) 27: 7: withRestarts(tryCatch(withCallingHandlers({tryCatch(expr, error = function(e) { eval(code, test_env) call <- conditionCall(e) new_expectations <- the$test_expectations > starting_expectations if (!is.null(call)) { if (snapshot_skipped) { if (identical(call[[1L]], quote(doTryCatch))) skip("On CRAN") call <- sys.call(-4L) } dcall <- deparse(call, nlines = 1L) else if (!new_expectations && skip_on_empty) { prefix <- paste("Error in", dcall, ": ") skip_empty() LONG <- 75L } sm <- strsplit(conditionMessage(e), "\n")[[1L]]}, expectation = handle_expectation, packageNotFoundError = function(e) { w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (on_cran()) { if (is.na(w)) skip(paste0("{", e$package, "} is not installed.")) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], } type = "b")}, snapshot_on_cran = function(cnd) { if (w > LONG) snapshot_skipped <<- TRUE prefix <- paste0(prefix, "\n ") invokeRestart("muffle_cran_snapshot") }}, skip = handle_skip, warning = handle_warning, message = handle_message, else prefix <- "Error : " error = handle_error, interrupt = handle_interrupt), error = handle_fatal), msg <- paste0(prefix, conditionMessage(e), "\n") end_test = function() { .Internal(seterrmessage(msg[1L])) }) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile)28: .Internal(printDeferredWarnings())test_code(code, parent.frame()) } invisible(structure(msg, class = "try-error", condition = e))29: })test_that("SimpleSBM_fit 'Bernoulli' model, directed, one covariate", { 8: sampler_directed_cov$rNetwork(store = TRUE)try(lapply(X = S, FUN = FUN, ...), silent = TRUE) mySBM_sbm <- sbm::SimpleSBM_fit$new(sampler_directed_cov$networkData, "bernoulli", TRUE, covarList = covarList_directed) 9: mySBM_sbm$optimize(estimOptions = list(verbosity = 0, sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE)) plot = FALSE)) mySBM_sbm$setModel(Q) net <- missSBM:::partlyObservedNetwork$new(sampler_directed_cov$networkData, 10: covariates = covarList_directed)FUN(X[[i]], ...) cls <- net$clustering(1:(2 * Q)) cl <- cls[[Q]]11: mySBM_missSBM <- missSBM:::SimpleSBM_fit_withCov$new(net, lapply(seq_len(cores), inner.do) clusterInit = cl, covarList = covarList_directed) mySBM_missSBM$doVEM(trace = TRUE)12: expect_lt(rmse(mySBM_missSBM$connectParam$mean, mySBM_sbm$connectParam$mean), parallel::mclapply(X, FUN, ..., mc.cores = mc.cores, mc.set.seed = FALSE, 0.1) mc.silent = TRUE) expect_gt(ARI(mySBM_missSBM$memberships, mySBM_sbm$memberships), 0.8)13: expect_lt(rmse(mySBM_missSBM$loglik, mySBM_sbm$loglik), parallel_lapply(inits, .self$do_one_estim, mc.cores = ncores, 0.05) verbose = (verbosity > 4)) expect_lt(rmse(mySBM_missSBM$connectParam$mean, sampler_directed_cov$connectParam$mean), 0.1)14: expect_gt(ARI(mySBM_missSBM$memberships, sampler_directed_cov$memberships), .self$do_with_inits(inits, Q, reinitialization_effort) 0.85) })15: .self$estim_ascend(reinitialization_effort, changing_effort)30: eval(code, test_env)16: private$BMobject$estimate()31: eval(code, test_env)17: mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE))32: withCallingHandlers({18: eval(code, test_env)eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) {19: skip("On CRAN")eval(code, test_env) } else if (!new_expectations && skip_on_empty) {20: skip_empty()withCallingHandlers({ } eval(code, test_env)}, expectation = handle_expectation, packageNotFoundError = function(e) { new_expectations <- the$test_expectations > starting_expectations if (on_cran()) { if (snapshot_skipped) { skip(paste0("{", e$package, "} is not installed.")) } skip("On CRAN")}, snapshot_on_cran = function(cnd) { } snapshot_skipped <<- TRUE else if (!new_expectations && skip_on_empty) { invokeRestart("muffle_cran_snapshot") skip_empty()}, skip = handle_skip, warning = handle_warning, message = handle_message, } error = handle_error, interrupt = handle_interrupt)}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) {33: skip(paste0("{", e$package, "} is not installed."))doTryCatch(return(expr), name, parentenv, handler) } }, snapshot_on_cran = function(cnd) {34: snapshot_skipped <<- TRUEtryCatchOne(expr, names, parentenv, handlers[[1L]]) invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt)35: tryCatchList(expr, classes, parentenv, handlers)21: doTryCatch(return(expr), name, parentenv, handler)36: tryCatch(withCallingHandlers({22: eval(code, test_env)tryCatchOne(expr, names, parentenv, handlers[[1L]]) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) {23: skip("On CRAN")tryCatchList(expr, classes, parentenv, handlers) } else if (!new_expectations && skip_on_empty) {24: skip_empty()tryCatch(withCallingHandlers({ } eval(code, test_env)}, expectation = handle_expectation, packageNotFoundError = function(e) { new_expectations <- the$test_expectations > starting_expectations if (on_cran()) { if (snapshot_skipped) { skip(paste0("{", e$package, "} is not installed.")) skip("On CRAN") } }}, snapshot_on_cran = function(cnd) { else if (!new_expectations && skip_on_empty) { snapshot_skipped <<- TRUE skip_empty() invokeRestart("muffle_cran_snapshot") }}, skip = handle_skip, warning = handle_warning, message = handle_message, }, expectation = handle_expectation, packageNotFoundError = function(e) { error = handle_error, interrupt = handle_interrupt), error = handle_fatal) if (on_cran()) { skip(paste0("{", e$package, "} is not installed."))37: }doWithOneRestart(return(expr), restart)}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE38: invokeRestart("muffle_cran_snapshot")withOneRestart(expr, restarts[[1L]])}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal)39: withRestarts(tryCatch(withCallingHandlers({25: eval(code, test_env)doWithOneRestart(return(expr), restart) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) {26: withOneRestart(expr, restarts[[1L]]) skip("On CRAN") }27: else if (!new_expectations && skip_on_empty) {withRestarts(tryCatch(withCallingHandlers({ skip_empty() eval(code, test_env) } new_expectations <- the$test_expectations > starting_expectations}, expectation = handle_expectation, packageNotFoundError = function(e) { if (snapshot_skipped) { if (on_cran()) { skip("On CRAN") skip(paste0("{", e$package, "} is not installed.")) } } else if (!new_expectations && skip_on_empty) {}, snapshot_on_cran = function(cnd) { skip_empty() snapshot_skipped <<- TRUE } invokeRestart("muffle_cran_snapshot")}, expectation = handle_expectation, packageNotFoundError = function(e) {}, skip = handle_skip, warning = handle_warning, message = handle_message, if (on_cran()) { error = handle_error, interrupt = handle_interrupt), error = handle_fatal), skip(paste0("{", e$package, "} is not installed.")) end_test = function() { }}, snapshot_on_cran = function(cnd) { }) snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")40: }, skip = handle_skip, warning = handle_warning, message = handle_message, test_code(code = exprs, env = env, reporter = get_reporter() %||% error = handle_error, interrupt = handle_interrupt), error = handle_fatal), StopReporter$new()) end_test = function() { })41: source_file(path, env = env(env), desc = desc, shuffle = shuffle, 28: error_call = error_call)test_code(code, parent.frame()) 42: 29: FUN(X[[i]], ...)test_that("SimpleSBM_fit 'Bernoulli' model, directed, one covariate", {43: sampler_directed_cov$rNetwork(store = TRUE)lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, mySBM_sbm <- sbm::SimpleSBM_fit$new(sampler_directed_cov$networkData, error_call = error_call) "bernoulli", TRUE, covarList = covarList_directed) mySBM_sbm$optimize(estimOptions = list(verbosity = 0, 44: plot = FALSE))doTryCatch(return(expr), name, parentenv, handler) mySBM_sbm$setModel(Q) net <- missSBM:::partlyObservedNetwork$new(sampler_directed_cov$networkData, 45: covariates = covarList_directed)tryCatchOne(expr, names, parentenv, handlers[[1L]]) cls <- net$clustering(1:(2 * Q)) cl <- cls[[Q]]46: mySBM_missSBM <- missSBM:::SimpleSBM_fit_withCov$new(net, tryCatchList(expr, classes, parentenv, handlers) clusterInit = cl, covarList = covarList_directed) mySBM_missSBM$doVEM(trace = TRUE)47: expect_lt(rmse(mySBM_missSBM$connectParam$mean, mySBM_sbm$connectParam$mean), tryCatch(code, testthat_abort_reporter = function(cnd) { 0.1) cat(conditionMessage(cnd), "\n") expect_gt(ARI(mySBM_missSBM$memberships, mySBM_sbm$memberships), NULL 0.8)}) expect_lt(rmse(mySBM_missSBM$loglik, mySBM_sbm$loglik), 0.05)48: expect_lt(rmse(mySBM_missSBM$connectParam$mean, sampler_directed_cov$connectParam$mean), with_reporter(reporters$multi, lapply(test_paths, test_one_file, 0.1) env = env, desc = desc, shuffle = shuffle, error_call = error_call)) expect_gt(ARI(mySBM_missSBM$memberships, sampler_directed_cov$memberships), 49: test_files_serial(test_dir = test_dir, test_package = test_package, 0.85) }) test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 30: desc = desc, load_package = load_package, shuffle = shuffle, error_call = error_call)eval(code, test_env) 50: 31: test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, eval(code, test_env) stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, load_package = load_package, parallel = parallel, shuffle = shuffle)32: withCallingHandlers({ eval(code, test_env)51: new_expectations <- the$test_expectations > starting_expectationstest_dir("testthat", package = package, reporter = reporter, if (snapshot_skipped) { ..., load_package = "installed") skip("On CRAN") 52: }test_check("missSBM") else if (!new_expectations && skip_on_empty) { skip_empty()An irrecoverable exception occurred. R is aborting now ... }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt) 33: doTryCatch(return(expr), name, parentenv, handler) 34: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 35: tryCatchList(expr, classes, parentenv, handlers) 36: tryCatch(withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal) 37: doWithOneRestart(return(expr), restart) 38: withOneRestart(expr, restarts[[1L]]) 39: withRestarts(tryCatch(withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal), end_test = function() { }) 40: test_code(code = exprs, env = env, reporter = get_reporter() %||% StopReporter$new()) 41: source_file(path, env = env(env), desc = desc, shuffle = shuffle, error_call = error_call) 42: FUN(X[[i]], ...) 43: lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call) 44: doTryCatch(return(expr), name, parentenv, handler) 45: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 46: tryCatchList(expr, classes, parentenv, handlers) 47: tryCatch(code, testthat_abort_reporter = function(cnd) { cat(conditionMessage(cnd), "\n") NULL}) 48: with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call)) 49: test_files_serial(test_dir = test_dir, test_package = test_package, test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, desc = desc, load_package = load_package, shuffle = shuffle, error_call = error_call) 50: test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, load_package = load_package, parallel = parallel, shuffle = shuffle) 51: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed") 52: test_check("missSBM") An irrecoverable exception occurred. R is aborting now ... Saving _problems/test-sbm-bernoulli-with-covariates-46.R *** caught segfault *** address 0x110, cause 'invalid permissions' *** caught segfault *** address 0x110, cause 'invalid permissions' Traceback: 1: Traceback: dispatcher(membership_name, membership_init$to_cc(), model_name, 1: .self$network_to_cc(), TRUE)dispatcher(membership_name, membership_init$to_cc(), model_name, .self$network_to_cc(), TRUE) 2: FUN(X[[i]], ...) 2: FUN(X[[i]], ...) 3: lapply(X = S, FUN = FUN, ...) 3: lapply(X = S, FUN = FUN, ...) 4: doTryCatch(return(expr), name, parentenv, handler) 4: doTryCatch(return(expr), name, parentenv, handler) 5: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 5: 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])tryCatchList(expr, classes, parentenv, handlers) 6: 7: tryCatchList(expr, classes, parentenv, handlers)tryCatch(expr, error = function(e) { call <- conditionCall(e) 7: if (!is.null(call)) {tryCatch(expr, error = function(e) { if (identical(call[[1L]], quote(doTryCatch))) call <- conditionCall(e) if (!is.null(call)) { call <- sys.call(-4L) if (identical(call[[1L]], quote(doTryCatch))) dcall <- deparse(call, nlines = 1L) call <- sys.call(-4L) prefix <- paste("Error in", dcall, ": ") dcall <- deparse(call, nlines = 1L) LONG <- 75L prefix <- paste("Error in", dcall, ": ") sm <- strsplit(conditionMessage(e), "\n")[[1L]] LONG <- 75L w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") sm <- strsplit(conditionMessage(e), "\n")[[1L]] if (is.na(w)) w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], if (is.na(w)) type = "b") w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], if (w > LONG) type = "b") prefix <- paste0(prefix, "\n ") if (w > LONG) } prefix <- paste0(prefix, "\n ") else prefix <- "Error : " } msg <- paste0(prefix, conditionMessage(e), "\n") else prefix <- "Error : " .Internal(seterrmessage(msg[1L])) msg <- paste0(prefix, conditionMessage(e), "\n") if (!silent && isTRUE(getOption("show.error.messages"))) { .Internal(seterrmessage(msg[1L])) cat(msg, file = outFile) if (!silent && isTRUE(getOption("show.error.messages"))) { .Internal(printDeferredWarnings()) cat(msg, file = outFile) } .Internal(printDeferredWarnings()) invisible(structure(msg, class = "try-error", condition = e)) }}) invisible(structure(msg, class = "try-error", condition = e)) }) 8: try(lapply(X = S, FUN = FUN, ...), silent = TRUE) 8: try(lapply(X = S, FUN = FUN, ...), silent = TRUE) 9: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE)) 9: 10: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))FUN(X[[i]], ...) 10: 11: FUN(X[[i]], ...)lapply(seq_len(cores), inner.do) 11: 12: lapply(seq_len(cores), inner.do)parallel::mclapply(X, FUN, ..., mc.cores = mc.cores, mc.set.seed = FALSE, mc.silent = TRUE)12: parallel::mclapply(X, FUN, ..., mc.cores = mc.cores, mc.set.seed = FALSE, 13: mc.silent = TRUE)parallel_lapply(inits, .self$do_one_estim, mc.cores = ncores, verbose = (verbosity > 4))13: parallel_lapply(inits, .self$do_one_estim, mc.cores = ncores, 14: verbose = (verbosity > 4)).self$do_with_inits(inits, Q, reinitialization_effort) 14: 15: .self$do_with_inits(inits, Q, reinitialization_effort).self$estim_ascend(reinitialization_effort, changing_effort) 15: 16: .self$estim_ascend(reinitialization_effort, changing_effort)private$BMobject$estimate() 16: 17: private$BMobject$estimate()mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) 17: 18: mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE))eval(code, test_env) 18: 19: eval(code, test_env)eval(code, test_env) 19: 20: eval(code, test_env)withCallingHandlers({ eval(code, test_env)20: new_expectations <- the$test_expectations > starting_expectationswithCallingHandlers({ if (snapshot_skipped) { eval(code, test_env) skip("On CRAN") new_expectations <- the$test_expectations > starting_expectations } if (snapshot_skipped) { else if (!new_expectations && skip_on_empty) { skip("On CRAN") skip_empty() } } else if (!new_expectations && skip_on_empty) {}, expectation = handle_expectation, packageNotFoundError = function(e) { skip_empty() if (on_cran()) { } skip(paste0("{", e$package, "} is not installed."))}, expectation = handle_expectation, packageNotFoundError = function(e) { } if (on_cran()) {}, snapshot_on_cran = function(cnd) { skip(paste0("{", e$package, "} is not installed.")) snapshot_skipped <<- TRUE } invokeRestart("muffle_cran_snapshot")}, snapshot_on_cran = function(cnd) {}, skip = handle_skip, warning = handle_warning, message = handle_message, snapshot_skipped <<- TRUE error = handle_error, interrupt = handle_interrupt) invokeRestart("muffle_cran_snapshot") }, skip = handle_skip, warning = handle_warning, message = handle_message, 21: error = handle_error, interrupt = handle_interrupt)doTryCatch(return(expr), name, parentenv, handler) 21: 22: doTryCatch(return(expr), name, parentenv, handler)tryCatchOne(expr, names, parentenv, handlers[[1L]]) 22: 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])tryCatchList(expr, classes, parentenv, handlers) 23: 24: tryCatchList(expr, classes, parentenv, handlers)tryCatch(withCallingHandlers({ eval(code, test_env)24: new_expectations <- the$test_expectations > starting_expectationstryCatch(withCallingHandlers({ if (snapshot_skipped) { eval(code, test_env) skip("On CRAN") new_expectations <- the$test_expectations > starting_expectations } if (snapshot_skipped) { else if (!new_expectations && skip_on_empty) { skip("On CRAN") skip_empty() } } else if (!new_expectations && skip_on_empty) {}, expectation = handle_expectation, packageNotFoundError = function(e) { skip_empty() if (on_cran()) { } skip(paste0("{", e$package, "} is not installed."))}, expectation = handle_expectation, packageNotFoundError = function(e) { } if (on_cran()) {}, snapshot_on_cran = function(cnd) { skip(paste0("{", e$package, "} is not installed.")) snapshot_skipped <<- TRUE } invokeRestart("muffle_cran_snapshot")}, snapshot_on_cran = function(cnd) {}, skip = handle_skip, warning = handle_warning, message = handle_message, snapshot_skipped <<- TRUE error = handle_error, interrupt = handle_interrupt), error = handle_fatal) invokeRestart("muffle_cran_snapshot") }, skip = handle_skip, warning = handle_warning, message = handle_message, 25: error = handle_error, interrupt = handle_interrupt), error = handle_fatal) doWithOneRestart(return(expr), restart)25: doWithOneRestart(return(expr), restart)26: withOneRestart(expr, restarts[[1L]])26: withOneRestart(expr, restarts[[1L]])27: withRestarts(tryCatch(withCallingHandlers({27: eval(code, test_env)withRestarts(tryCatch(withCallingHandlers({ new_expectations <- the$test_expectations > starting_expectations eval(code, test_env) if (snapshot_skipped) { new_expectations <- the$test_expectations > starting_expectations skip("On CRAN") if (snapshot_skipped) { skip("On CRAN") } } else if (!new_expectations && skip_on_empty) { else if (!new_expectations && skip_on_empty) { skip_empty() skip_empty() } }}, expectation = handle_expectation, packageNotFoundError = function(e) {}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) skip(paste0("{", e$package, "} is not installed.")) } }}, snapshot_on_cran = function(cnd) {}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot") invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, }, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal), error = handle_error, interrupt = handle_interrupt), error = handle_fatal), end_test = function() { end_test = function() { }) }) 28: 28: test_code(code, parent.frame())test_code(code, parent.frame()) 29: 29: test_that("SimpleSBM_fit 'Bernoulli' model, undirected, no covariate", test_that("SimpleSBM_fit 'Bernoulli' model, undirected, no covariate", { { sampler_undirected_nocov$rNetwork(store = TRUE) sampler_undirected_nocov$rNetwork(store = TRUE) mySBM_sbm <- sbm::SimpleSBM_fit$new(sampler_undirected_nocov$networkData, mySBM_sbm <- sbm::SimpleSBM_fit$new(sampler_undirected_nocov$networkData, "bernoulli", FALSE) "bernoulli", FALSE) mySBM_sbm$optimize(estimOptions = list(verbosity = 0, mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) plot = FALSE)) mySBM_sbm$setModel(3) mySBM_sbm$setModel(3) net <- missSBM:::partlyObservedNetwork$new(sampler_undirected_nocov$networkData) net <- missSBM:::partlyObservedNetwork$new(sampler_undirected_nocov$networkData) cl <- net$clustering(3)[[1]] cl <- net$clustering(3)[[1]] mySBM_missSBM <- missSBM:::SimpleSBM_fit_noCov$new(net, mySBM_missSBM <- missSBM:::SimpleSBM_fit_noCov$new(net, clusterInit = cl) clusterInit = cl) mySBM_missSBM$doVEM() mySBM_missSBM$doVEM() expect_lt(rmse(mySBM_missSBM$connectParam$mean, mySBM_sbm$connectParam$mean), expect_lt(rmse(mySBM_missSBM$connectParam$mean, mySBM_sbm$connectParam$mean), 0.05) 0.05) expect_gt(ARI(mySBM_missSBM$memberships, mySBM_sbm$memberships), expect_gt(ARI(mySBM_missSBM$memberships, mySBM_sbm$memberships), 0.95) 0.95) expect_lt(rmse(mySBM_missSBM$loglik, mySBM_sbm$loglik), expect_lt(rmse(mySBM_missSBM$loglik, mySBM_sbm$loglik), 0.01) 0.01) expect_lt(rmse(mySBM_missSBM$connectParam$mean, sampler_undirected_nocov$connectParam$mean), expect_lt(rmse(mySBM_missSBM$connectParam$mean, sampler_undirected_nocov$connectParam$mean), 0.05) 0.05) expect_gt(ARI(mySBM_missSBM$memberships, sampler_undirected_nocov$memberships), expect_gt(ARI(mySBM_missSBM$memberships, sampler_undirected_nocov$memberships), 0.95) 0.95) }) }) 30: 30: eval(code, test_env)eval(code, test_env) 31: 31: eval(code, test_env)eval(code, test_env) 32: 32: withCallingHandlers({withCallingHandlers({ eval(code, test_env) eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { if (snapshot_skipped) { skip("On CRAN") skip("On CRAN") } } else if (!new_expectations && skip_on_empty) { else if (!new_expectations && skip_on_empty) { skip_empty() skip_empty() } }}, expectation = handle_expectation, packageNotFoundError = function(e) {}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) skip(paste0("{", e$package, "} is not installed.")) } }}, snapshot_on_cran = function(cnd) {}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot") invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, }, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt) error = handle_error, interrupt = handle_interrupt) 33: 33: doTryCatch(return(expr), name, parentenv, handler)doTryCatch(return(expr), name, parentenv, handler) 34: 34: tryCatchOne(expr, names, parentenv, handlers[[1L]])tryCatchOne(expr, names, parentenv, handlers[[1L]]) 35: 35: tryCatchList(expr, classes, parentenv, handlers)tryCatchList(expr, classes, parentenv, handlers) 36: 36: tryCatch(withCallingHandlers({tryCatch(withCallingHandlers({ eval(code, test_env) eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { if (snapshot_skipped) { skip("On CRAN") skip("On CRAN") } } else if (!new_expectations && skip_on_empty) { else if (!new_expectations && skip_on_empty) { skip_empty() skip_empty() } }}, expectation = handle_expectation, packageNotFoundError = function(e) {}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) skip(paste0("{", e$package, "} is not installed.")) } }}, snapshot_on_cran = function(cnd) {}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot") invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, }, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal) error = handle_error, interrupt = handle_interrupt), error = handle_fatal) 37: 37: doWithOneRestart(return(expr), restart)doWithOneRestart(return(expr), restart) 38: 38: withOneRestart(expr, restarts[[1L]])withOneRestart(expr, restarts[[1L]]) 39: 39: withRestarts(tryCatch(withCallingHandlers({withRestarts(tryCatch(withCallingHandlers({ eval(code, test_env) eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { if (snapshot_skipped) { skip("On CRAN") skip("On CRAN") } } else if (!new_expectations && skip_on_empty) { else if (!new_expectations && skip_on_empty) { skip_empty() skip_empty() } }}, expectation = handle_expectation, packageNotFoundError = function(e) {}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) skip(paste0("{", e$package, "} is not installed.")) } }}, snapshot_on_cran = function(cnd) {}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot") invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, }, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal), error = handle_error, interrupt = handle_interrupt), error = handle_fatal), end_test = function() { end_test = function() { }) }) 40: 40: test_code(code = exprs, env = env, reporter = get_reporter() %||% test_code(code = exprs, env = env, reporter = get_reporter() %||% StopReporter$new()) StopReporter$new()) 41: 41: source_file(path, env = env(env), desc = desc, shuffle = shuffle, source_file(path, env = env(env), desc = desc, shuffle = shuffle, error_call = error_call) error_call = error_call) 42: 42: FUN(X[[i]], ...)FUN(X[[i]], ...) 43: 43: lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call) error_call = error_call) 44: 44: doTryCatch(return(expr), name, parentenv, handler)doTryCatch(return(expr), name, parentenv, handler) 45: 45: tryCatchOne(expr, names, parentenv, handlers[[1L]])tryCatchOne(expr, names, parentenv, handlers[[1L]]) 46: 46: tryCatchList(expr, classes, parentenv, handlers)tryCatchList(expr, classes, parentenv, handlers) 47: 47: tryCatch(code, testthat_abort_reporter = function(cnd) {tryCatch(code, testthat_abort_reporter = function(cnd) { cat(conditionMessage(cnd), "\n") cat(conditionMessage(cnd), "\n") NULL NULL})}) 48: 48: with_reporter(reporters$multi, lapply(test_paths, test_one_file, with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call)) env = env, desc = desc, shuffle = shuffle, error_call = error_call)) 49: 49: test_files_serial(test_dir = test_dir, test_package = test_package, test_files_serial(test_dir = test_dir, test_package = test_package, test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, desc = desc, load_package = load_package, shuffle = shuffle, desc = desc, load_package = load_package, shuffle = shuffle, error_call = error_call) error_call = error_call) 50: 50: test_files(test_dir = path, test_paths = test_paths, test_package = package, test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, reporter = reporter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, load_package = load_package, parallel = parallel, shuffle = shuffle) load_package = load_package, parallel = parallel, shuffle = shuffle) 51: 51: test_dir("testthat", package = package, reporter = reporter, test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed") ..., load_package = "installed") 52: 52: test_check("missSBM")test_check("missSBM") An irrecoverable exception occurred. R is aborting now ... An irrecoverable exception occurred. R is aborting now ... Saving _problems/test-sbm-bernoulli-without-covariate-16.R *** caught segfault *** address 0x110, cause 'invalid permissions' *** caught segfault *** address 0x110, cause 'invalid permissions' Traceback: 1: dispatcher(membership_name, membership_init$to_cc(), model_name, .self$network_to_cc(), TRUE) 2: FUN(X[[i]], ...) 3: lapply(X = S, FUN = FUN, ...) 4: doTryCatch(return(expr), name, parentenv, handler) 5: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 6: tryCatchList(expr, classes, parentenv, handlers) 7: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call, nlines = 1L) prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))}) 8: try(lapply(X = S, FUN = FUN, ...), silent = TRUE) 9: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE)) 10: FUN(X[[i]], ...) 11: lapply(seq_len(cores), inner.do) 12: parallel::mclapply(X, FUN, ..., mc.cores = mc.cores, mc.set.seed = FALSE, mc.silent = TRUE) 13: parallel_lapply(inits, .self$do_one_estim, mc.cores = ncores, verbose = (verbosity > 4)) Traceback: 14: 1: .self$do_with_inits(inits, Q, reinitialization_effort)dispatcher(membership_name, membership_init$to_cc(), model_name, .self$network_to_cc(), TRUE) 15: 2: .self$estim_ascend(reinitialization_effort, changing_effort)FUN(X[[i]], ...) 16: private$BMobject$estimate() 3: 17: lapply(X = S, FUN = FUN, ...)mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) 18: eval(code, test_env) 4: doTryCatch(return(expr), name, parentenv, handler) 19: eval(code, test_env) 5: tryCatchOne(expr, names, parentenv, handlers[[1L]])20: withCallingHandlers({ eval(code, test_env) 6: new_expectations <- the$test_expectations > starting_expectationstryCatchList(expr, classes, parentenv, handlers) if (snapshot_skipped) { 7: skip("On CRAN")tryCatch(expr, error = function(e) { } else if (!new_expectations && skip_on_empty) { call <- conditionCall(e) skip_empty() if (!is.null(call)) { }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (identical(call[[1L]], quote(doTryCatch))) if (on_cran()) { call <- sys.call(-4L) skip(paste0("{", e$package, "} is not installed.")) dcall <- deparse(call, nlines = 1L) } prefix <- paste("Error in", dcall, ": ")}, snapshot_on_cran = function(cnd) { LONG <- 75L snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot") sm <- strsplit(conditionMessage(e), "\n")[[1L]]}, skip = handle_skip, warning = handle_warning, message = handle_message, w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") error = handle_error, interrupt = handle_interrupt) if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b")21: if (w > LONG) doTryCatch(return(expr), name, parentenv, handler) prefix <- paste0(prefix, "\n ") } 22: else prefix <- "Error : "tryCatchOne(expr, names, parentenv, handlers[[1L]]) msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L]))23: if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile)tryCatchList(expr, classes, parentenv, handlers) .Internal(printDeferredWarnings()) 24: }tryCatch(withCallingHandlers({ invisible(structure(msg, class = "try-error", condition = e)) eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations}) if (snapshot_skipped) { skip("On CRAN") 8: }try(lapply(X = S, FUN = FUN, ...), silent = TRUE) else if (!new_expectations && skip_on_empty) { skip_empty() 9: }sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) {10: skip(paste0("{", e$package, "} is not installed.")) }FUN(X[[i]], ...)}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE11: invokeRestart("muffle_cran_snapshot")lapply(seq_len(cores), inner.do)}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal) 12: 25: parallel::mclapply(X, FUN, ..., mc.cores = mc.cores, mc.set.seed = FALSE, doWithOneRestart(return(expr), restart) mc.silent = TRUE) 26: withOneRestart(expr, restarts[[1L]])13: parallel_lapply(inits, .self$do_one_estim, mc.cores = ncores, 27: withRestarts(tryCatch(withCallingHandlers({ verbose = (verbosity > 4)) eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) {14: skip("On CRAN").self$do_with_inits(inits, Q, reinitialization_effort) } else if (!new_expectations && skip_on_empty) { skip_empty()15: }.self$estim_ascend(reinitialization_effort, changing_effort)}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) {16: skip(paste0("{", e$package, "} is not installed.")) }private$BMobject$estimate()}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE17: invokeRestart("muffle_cran_snapshot")mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE))}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal), 18: end_test = function() {eval(code, test_env) }) 19: 28: test_code(code, parent.frame())eval(code, test_env) 29: 20: withCallingHandlers({test_that("SimpleSBM_fit 'Bernoulli' model, directed, no covariate", eval(code, test_env) { new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { sampler_directed_nocov$rNetwork(store = TRUE) skip("On CRAN") mySBM_sbm <- sbm::SimpleSBM_fit$new(sampler_directed_nocov$networkData, } "bernoulli", TRUE) else if (!new_expectations && skip_on_empty) { mySBM_sbm$optimize(estimOptions = list(verbosity = 0, skip_empty() } plot = FALSE)) mySBM_sbm$setModel(3)}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { net <- missSBM:::partlyObservedNetwork$new(sampler_directed_nocov$networkData) skip(paste0("{", e$package, "} is not installed.")) cl <- net$clustering(3)[[1]] } mySBM_missSBM <- missSBM:::SimpleSBM_fit_noCov$new(sampler_directed_nocov$networkData, }, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE clusterInit = cl) invokeRestart("muffle_cran_snapshot") mySBM_missSBM$doVEM()}, skip = handle_skip, warning = handle_warning, message = handle_message, expect_lt(rmse(mySBM_missSBM$connectParam$mean, mySBM_sbm$connectParam$mean), error = handle_error, interrupt = handle_interrupt) 0.1) expect_gt(ARI(mySBM_missSBM$memberships, mySBM_sbm$memberships), 21: 0.95)doTryCatch(return(expr), name, parentenv, handler) expect_lt(rmse(mySBM_missSBM$loglik, mySBM_sbm$loglik), 0.01)22: expect_lt(rmse(mySBM_missSBM$connectParam$mean, sampler_directed_nocov$connectParam$mean), tryCatchOne(expr, names, parentenv, handlers[[1L]]) 0.1) expect_lt(rmse(mySBM_missSBM$covarParam, sampler_directed_cov$covarParam), 0.2)23: expect_gt(ARI(mySBM_missSBM$memberships, sampler_directed_nocov$memberships), tryCatchList(expr, classes, parentenv, handlers) 0.95) })24: tryCatch(withCallingHandlers({30: eval(code, test_env) eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations31: if (snapshot_skipped) {eval(code, test_env) skip("On CRAN") }32: else if (!new_expectations && skip_on_empty) {withCallingHandlers({ skip_empty() eval(code, test_env) } new_expectations <- the$test_expectations > starting_expectations}, expectation = handle_expectation, packageNotFoundError = function(e) { if (snapshot_skipped) { skip("On CRAN") if (on_cran()) { } skip(paste0("{", e$package, "} is not installed.")) else if (!new_expectations && skip_on_empty) { } skip_empty()}, snapshot_on_cran = function(cnd) { }}, expectation = handle_expectation, packageNotFoundError = function(e) { snapshot_skipped <<- TRUE if (on_cran()) { invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, skip(paste0("{", e$package, "} is not installed.")) error = handle_error, interrupt = handle_interrupt), error = handle_fatal) } }, snapshot_on_cran = function(cnd) {25: snapshot_skipped <<- TRUEdoWithOneRestart(return(expr), restart) invokeRestart("muffle_cran_snapshot") 26: }, skip = handle_skip, warning = handle_warning, message = handle_message, withOneRestart(expr, restarts[[1L]]) error = handle_error, interrupt = handle_interrupt) 27: 33: withRestarts(tryCatch(withCallingHandlers({doTryCatch(return(expr), name, parentenv, handler) eval(code, test_env)34: new_expectations <- the$test_expectations > starting_expectationstryCatchOne(expr, names, parentenv, handlers[[1L]]) if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) {35: skip_empty()tryCatchList(expr, classes, parentenv, handlers) } }, expectation = handle_expectation, packageNotFoundError = function(e) {36: if (on_cran()) {tryCatch(withCallingHandlers({ skip(paste0("{", e$package, "} is not installed.")) eval(code, test_env) } new_expectations <- the$test_expectations > starting_expectations}, snapshot_on_cran = function(cnd) { if (snapshot_skipped) { skip("On CRAN") snapshot_skipped <<- TRUE } invokeRestart("muffle_cran_snapshot") else if (!new_expectations && skip_on_empty) {}, skip = handle_skip, warning = handle_warning, message = handle_message, skip_empty() error = handle_error, interrupt = handle_interrupt), error = handle_fatal), } end_test = function() {}, expectation = handle_expectation, packageNotFoundError = function(e) { }) if (on_cran()) { skip(paste0("{", e$package, "} is not installed."))28: }test_code(code, parent.frame())}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE29: invokeRestart("muffle_cran_snapshot")test_that("SimpleSBM_fit 'Bernoulli' model, directed, no covariate", }, skip = handle_skip, warning = handle_warning, message = handle_message, { error = handle_error, interrupt = handle_interrupt), error = handle_fatal) sampler_directed_nocov$rNetwork(store = TRUE) mySBM_sbm <- sbm::SimpleSBM_fit$new(sampler_directed_nocov$networkData, 37: "bernoulli", TRUE)doWithOneRestart(return(expr), restart) mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE))38: mySBM_sbm$setModel(3)withOneRestart(expr, restarts[[1L]]) net <- missSBM:::partlyObservedNetwork$new(sampler_directed_nocov$networkData) cl <- net$clustering(3)[[1]]39: mySBM_missSBM <- missSBM:::SimpleSBM_fit_noCov$new(sampler_directed_nocov$networkData, withRestarts(tryCatch(withCallingHandlers({ clusterInit = cl) eval(code, test_env) mySBM_missSBM$doVEM() expect_lt(rmse(mySBM_missSBM$connectParam$mean, mySBM_sbm$connectParam$mean), new_expectations <- the$test_expectations > starting_expectations 0.1) if (snapshot_skipped) { skip("On CRAN") expect_gt(ARI(mySBM_missSBM$memberships, mySBM_sbm$memberships), } 0.95) else if (!new_expectations && skip_on_empty) { expect_lt(rmse(mySBM_missSBM$loglik, mySBM_sbm$loglik), skip_empty() 0.01) } expect_lt(rmse(mySBM_missSBM$connectParam$mean, sampler_directed_nocov$connectParam$mean), }, expectation = handle_expectation, packageNotFoundError = function(e) { 0.1) if (on_cran()) { expect_lt(rmse(mySBM_missSBM$covarParam, sampler_directed_cov$covarParam), skip(paste0("{", e$package, "} is not installed.")) 0.2) } expect_gt(ARI(mySBM_missSBM$memberships, sampler_directed_nocov$memberships), }, snapshot_on_cran = function(cnd) { 0.95) snapshot_skipped <<- TRUE }) invokeRestart("muffle_cran_snapshot") }, skip = handle_skip, warning = handle_warning, message = handle_message, 30: error = handle_error, interrupt = handle_interrupt), error = handle_fatal), eval(code, test_env) end_test = function() { })31: eval(code, test_env)40: test_code(code = exprs, env = env, reporter = get_reporter() %||% 32: StopReporter$new())withCallingHandlers({ eval(code, test_env)41: new_expectations <- the$test_expectations > starting_expectationssource_file(path, env = env(env), desc = desc, shuffle = shuffle, if (snapshot_skipped) { error_call = error_call) skip("On CRAN") }42: else if (!new_expectations && skip_on_empty) {FUN(X[[i]], ...) skip_empty()43: }lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, }, expectation = handle_expectation, packageNotFoundError = function(e) { error_call = error_call) if (on_cran()) { skip(paste0("{", e$package, "} is not installed."))44: doTryCatch(return(expr), name, parentenv, handler) } }, snapshot_on_cran = function(cnd) {45: snapshot_skipped <<- TRUEtryCatchOne(expr, names, parentenv, handlers[[1L]]) invokeRestart("muffle_cran_snapshot") }, skip = handle_skip, warning = handle_warning, message = handle_message, 46: error = handle_error, interrupt = handle_interrupt)tryCatchList(expr, classes, parentenv, handlers) 33: 47: doTryCatch(return(expr), name, parentenv, handler)tryCatch(code, testthat_abort_reporter = function(cnd) { cat(conditionMessage(cnd), "\n")34: NULLtryCatchOne(expr, names, parentenv, handlers[[1L]])}) 35: 48: tryCatchList(expr, classes, parentenv, handlers)with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call))36: tryCatch(withCallingHandlers({49: eval(code, test_env)test_files_serial(test_dir = test_dir, test_package = test_package, new_expectations <- the$test_expectations > starting_expectations test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, if (snapshot_skipped) { env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, skip("On CRAN") desc = desc, load_package = load_package, shuffle = shuffle, } error_call = error_call) else if (!new_expectations && skip_on_empty) { 50: test_files(test_dir = path, test_paths = test_paths, test_package = package, skip_empty() reporter = reporter, load_helpers = load_helpers, env = env, } stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, }, expectation = handle_expectation, packageNotFoundError = function(e) { load_package = load_package, parallel = parallel, shuffle = shuffle) if (on_cran()) { skip(paste0("{", e$package, "} is not installed."))51: }test_dir("testthat", package = package, reporter = reporter, }, snapshot_on_cran = function(cnd) { ..., load_package = "installed") snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, 52: error = handle_error, interrupt = handle_interrupt), error = handle_fatal)test_check("missSBM") 37: An irrecoverable exception occurred. R is aborting now ... doWithOneRestart(return(expr), restart) 38: withOneRestart(expr, restarts[[1L]]) 39: withRestarts(tryCatch(withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) { skip_empty() }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { skip(paste0("{", e$package, "} is not installed.")) }}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error, interrupt = handle_interrupt), error = handle_fatal), end_test = function() { }) 40: test_code(code = exprs, env = env, reporter = get_reporter() %||% StopReporter$new()) 41: source_file(path, env = env(env), desc = desc, shuffle = shuffle, error_call = error_call) 42: FUN(X[[i]], ...) 43: lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call) 44: doTryCatch(return(expr), name, parentenv, handler) 45: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 46: tryCatchList(expr, classes, parentenv, handlers) 47: tryCatch(code, testthat_abort_reporter = function(cnd) { cat(conditionMessage(cnd), "\n") NULL}) 48: with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call)) 49: test_files_serial(test_dir = test_dir, test_package = test_package, test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, desc = desc, load_package = load_package, shuffle = shuffle, error_call = error_call) 50: test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, load_package = load_package, parallel = parallel, shuffle = shuffle) 51: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed") 52: test_check("missSBM") An irrecoverable exception occurred. R is aborting now ... Saving _problems/test-sbm-bernoulli-without-covariate-44.R [ FAIL 4 | WARN 4 | SKIP 3 | PASS 531 ] ══ Skipped tests (3) ═══════════════════════════════════════════════════════════ • On CRAN (3): 'test-explore-block-count.R:4:3', 'test-missSBM_collection-degenerate.R:80:3', 'test-missSBM_collection-estimate_chain.R:64:3' ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-sbm-bernoulli-with-covariates.R:16:3'): SimpleSBM_fit 'Bernoulli' model, undirected, one covariate ── Error: invalid assignment for reference class field 'Z', should be from class "matrix" or a subclass (was class "NULL") Backtrace: ▆ 1. ├─mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) at test-sbm-bernoulli-with-covariates.R:16:3 2. │ └─private$BMobject$estimate() 3. │ └─.self$estim_ascend(reinitialization_effort, changing_effort) 4. │ └─.self$do_with_inits(inits, Q, reinitialization_effort) 5. │ └─base::sapply(...) 6. │ └─base::lapply(X = X, FUN = FUN, ...) 7. │ └─blockmodels (local) FUN(X[[i]], ...) 8. │ └─getRefClass(membership_name)(from_cc = r$membership) 9. │ └─methods::new(`<chr>`, ...) 10. │ ├─methods::initialize(value, ...) 11. │ └─methods::initialize(value, ...) 12. │ └─.Object$initialize(...) 13. └─blockmodels (local) `<dfltBndF>`(base::quote(NULL)) 14. └─methods:::.setDummyField(...) ── Error ('test-sbm-bernoulli-with-covariates.R:46:3'): SimpleSBM_fit 'Bernoulli' model, directed, one covariate ── Error: invalid assignment for reference class field 'Z', should be from class "matrix" or a subclass (was class "NULL") Backtrace: ▆ 1. ├─mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) at test-sbm-bernoulli-with-covariates.R:46:3 2. │ └─private$BMobject$estimate() 3. │ └─.self$estim_ascend(reinitialization_effort, changing_effort) 4. │ └─.self$do_with_inits(inits, Q, reinitialization_effort) 5. │ └─base::sapply(...) 6. │ └─base::lapply(X = X, FUN = FUN, ...) 7. │ └─blockmodels (local) FUN(X[[i]], ...) 8. │ └─getRefClass(membership_name)(from_cc = r$membership) 9. │ └─methods::new(`<chr>`, ...) 10. │ ├─methods::initialize(value, ...) 11. │ └─methods::initialize(value, ...) 12. │ └─.Object$initialize(...) 13. └─blockmodels (local) `<dfltBndF>`(base::quote(NULL)) 14. └─methods:::.setDummyField(...) ── Error ('test-sbm-bernoulli-without-covariate.R:16:3'): SimpleSBM_fit 'Bernoulli' model, undirected, no covariate ── Error: invalid assignment for reference class field 'Z', should be from class "matrix" or a subclass (was class "NULL") Backtrace: ▆ 1. ├─mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) at test-sbm-bernoulli-without-covariate.R:16:3 2. │ └─private$BMobject$estimate() 3. │ └─.self$estim_ascend(reinitialization_effort, changing_effort) 4. │ └─.self$do_with_inits(inits, Q, reinitialization_effort) 5. │ └─base::sapply(...) 6. │ └─base::lapply(X = X, FUN = FUN, ...) 7. │ └─blockmodels (local) FUN(X[[i]], ...) 8. │ └─getRefClass(membership_name)(from_cc = r$membership) 9. │ └─methods::new(`<chr>`, ...) 10. │ ├─methods::initialize(value, ...) 11. │ └─methods::initialize(value, ...) 12. │ └─.Object$initialize(...) 13. └─blockmodels (local) `<dfltBndF>`(base::quote(NULL)) 14. └─methods:::.setDummyField(...) ── Error ('test-sbm-bernoulli-without-covariate.R:44:3'): SimpleSBM_fit 'Bernoulli' model, directed, no covariate ── Error: invalid assignment for reference class field 'Z', should be from class "matrix" or a subclass (was class "NULL") Backtrace: ▆ 1. ├─mySBM_sbm$optimize(estimOptions = list(verbosity = 0, plot = FALSE)) at test-sbm-bernoulli-without-covariate.R:44:3 2. │ └─private$BMobject$estimate() 3. │ └─.self$estim_ascend(reinitialization_effort, changing_effort) 4. │ └─.self$do_with_inits(inits, Q, reinitialization_effort) 5. │ └─base::sapply(...) 6. │ └─base::lapply(X = X, FUN = FUN, ...) 7. │ └─blockmodels (local) FUN(X[[i]], ...) 8. │ └─getRefClass(membership_name)(from_cc = r$membership) 9. │ └─methods::new(`<chr>`, ...) 10. │ ├─methods::initialize(value, ...) 11. │ └─methods::initialize(value, ...) 12. │ └─.Object$initialize(...) 13. └─blockmodels (local) `<dfltBndF>`(base::quote(NULL)) 14. └─methods:::.setDummyField(...) [ FAIL 4 | WARN 4 | SKIP 3 | PASS 531 ] Error: ! Test failures. Execution halted Flavor: r-oldrel-macos-arm64