Last updated on 2024-06-17 06:50:42 CEST.
Package | ERROR | NOTE |
---|---|---|
reservr | 5 | 8 |
Current CRAN status: ERROR: 5, NOTE: 8
clang-UBSAN gcc-UBSAN valgrind
Version: 0.0.2
Check: for GNU extensions in Makefiles
Result: NOTE
GNU make is a SystemRequirements.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-macos-arm64, r-release-macos-x86_64, r-release-windows-x86_64, r-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64
Version: 0.0.2
Check: examples
Result: ERROR
Running examples in ‘reservr-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: fit_erlang_mixture
> ### Title: Fit an Erlang mixture using an ECME-Algorithm
> ### Aliases: fit_erlang_mixture
>
> ### ** Examples
>
> dist <- dist_erlangmix(list(NULL, NULL, NULL))
> params <- list(
+ shapes = list(1L, 4L, 12L),
+ scale = 2.0,
+ probs = list(0.5, 0.3, 0.2)
+ )
> x <- dist$sample(100L, with_params = params)
> fit_erlang_mixture(dist, x, init = "kmeans")
*** caught segfault ***
address 0x1, cause 'memory not mapped'
Traceback:
1: pgamma_diff_matrix(obs$xmin[i_cens], obs$xmax[i_cens], shapes, scale)
2: .erlang_dens_mat(obs, shapes, scale, i_obs, i_cens)
3: .erlang_em(obs = obs, probs = as.numeric(params$probs), shapes = shapes, scale = params$scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
4: em_fit(shapes, list(probs = as.list(probs), scale = scale))
5: .erlang_shape_search(obs = obs, probs = probs, shapes = shapes, scale = scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
6: fit_erlang_mixture(dist, x, init = "kmeans")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
fit_dist 6.395 0.117 8
Flavor: r-devel-linux-x86_64-debian-clang
Version: 0.0.2
Check: tests
Result: ERROR
Running ‘testthat.R’ [10s/12s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(reservr)
>
> test_check("reservr")
── Skip ('/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/reservr.Rcheck/tests/testthat/helpers.R:13:3'): set floatx to 64-bit ──
Reason: TensorFlow not available for testing
*** caught segfault ***
address 0x1, cause 'memory not mapped'
Traceback:
1: pgamma_diff_matrix(obs$xmin[i_cens], obs$xmax[i_cens], shapes, scale)
2: .erlang_dens_mat(obs, shapes, scale, i_obs, i_cens)
3: .erlang_em(obs = obs, probs = as.numeric(params$probs), shapes = shapes, scale = params$scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
4: em_fit(shapes, list(probs = as.list(probs), scale = scale))
5: .erlang_shape_search(obs = obs, probs = probs, shapes = shapes, scale = scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
6: fit_dist.ErlangMixtureDistribution(dist = object, obs = obs, start = start, ...)
7: fit_dist(dist = object, obs = obs, start = start, ...)
8: fit.Distribution(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
9: fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
10: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
11: withVisible(code)
12: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
13: force(code)
14: withr::with_output_sink(path, withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message))
15: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), ...)
16: quasi_capture(enquo(object), NULL, evaluate_promise)
17: expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes)))
18: eval(code, test_env)
19: eval(code, test_env)
20: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
21: doTryCatch(return(expr), name, parentenv, handler)
22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
23: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
24: doTryCatch(return(expr), name, parentenv, handler)
25: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
26: tryCatchList(expr, classes, parentenv, handlers)
27: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
28: test_code(desc, code, env = parent.frame(), default_reporter = local_interactive_reporter())
29: test_that("erlang mixture distribution works", { set.seed(1337L) dist <- dist_erlangmix(list(NULL, NULL, NULL)) params <- list(shapes = list(1L, 4L, 12L), scale = 2, probs = list(0.5, 0.3, 0.2)) alt_params <- list(shapes = list(2L, 6L, 100L), scale = 0.1, probs = list(0.7, 0.2, 0.1)) x <- dist$sample(100L, with_params = params) expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes))) expect_silent(fit(dist, x, init = "fan", spread = 3L)) expect_silent(fit(dist, x, init = "kmeans")) expect_silent(fit(dist, x, init = "cmm")) expect_identical(dist$get_type(), "continuous") expect_density(dist, function(x, log = FALSE, ...) { params <- list(...) res <- (params$probs[[1L]] * dgamma(x, shape = params$shapes[[1L]], scale = params$scale) + params$probs[[2L]] * dgamma(x, shape = params$shapes[[2L]], scale = params$scale) + params$probs[[3L]] * dgamma(x, shape = params$shapes[[3L]], scale = params$scale))/sum(as.numeric(params$probs)) if (log) log(res) else res }, params, x) expect_probability(dist, function(q, lower.tail = TRUE, log.p = FALSE, ...) { params <- list(...) res <- (params$probs[[1L]] * pgamma(q, shape = params$shapes[[1L]], scale = params$scale, lower.tail = lower.tail) + params$probs[[2L]] * pgamma(q, shape = params$shapes[[2L]], scale = params$scale, lower.tail = lower.tail) + params$probs[[3L]] * pgamma(q, shape = params$shapes[[3L]], scale = params$scale, lower.tail = lower.tail))/sum(as.numeric(params$probs)) if (log.p) log(res) else res }, params, x) expect_identical(dist$is_in_support(x), rep_len(TRUE, length(x))) expect_diff_density(dist, x, params) expect_diff_density(dist, x, alt_params) expect_tf_logdensity(dist, params, x) expect_tf_logdensity(dist, alt_params, x, tolerance = 1e-05) expect_tf_logprobability(dist, params, x, x + 1) expect_tf_logprobability(dist, params, x, rep_len(Inf, 100L)) expect_tf_logprobability(dist, params, rep_len(0, 100L), x) x_alt <- dist$sample(100L, with_params = alt_params) expect_tf_logprobability(dist, alt_params, x_alt, x_alt + 1) expect_iprobability(dist, params, x, x + 1) expect_iprobability(dist, params, 0, x) expect_iprobability(dist, params, x, Inf) dist$default_params$shapes <- params$shapes expect_tf_fit(dist, params[c("scale", "probs")], I_POSITIVE_REALS)})
30: eval(code, test_env)
31: eval(code, test_env)
32: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
33: doTryCatch(return(expr), name, parentenv, handler)
34: tryCatchOne(expr, names, parentenv, handlers[[1L]])
35: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
36: doTryCatch(return(expr), name, parentenv, handler)
37: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
38: tryCatchList(expr, classes, parentenv, handlers)
39: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
40: test_code(test = NULL, code = exprs, env = env, default_reporter = StopReporter$new())
41: source_file(path, env = env(env), desc = desc, error_call = error_call)
42: FUN(X[[i]], ...)
43: lapply(test_paths, test_one_file, env = env, desc = desc, 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, 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, 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)
51: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
52: test_check("reservr")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
Flavor: r-devel-linux-x86_64-debian-clang
Version: 0.0.2
Check: examples
Result: ERROR
Running examples in ‘reservr-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: fit_erlang_mixture
> ### Title: Fit an Erlang mixture using an ECME-Algorithm
> ### Aliases: fit_erlang_mixture
>
> ### ** Examples
>
> dist <- dist_erlangmix(list(NULL, NULL, NULL))
> params <- list(
+ shapes = list(1L, 4L, 12L),
+ scale = 2.0,
+ probs = list(0.5, 0.3, 0.2)
+ )
> x <- dist$sample(100L, with_params = params)
> fit_erlang_mixture(dist, x, init = "kmeans")
*** caught segfault ***
address 0x1, cause 'memory not mapped'
Traceback:
1: pgamma_diff_matrix(obs$xmin[i_cens], obs$xmax[i_cens], shapes, scale)
2: .erlang_dens_mat(obs, shapes, scale, i_obs, i_cens)
3: .erlang_em(obs = obs, probs = as.numeric(params$probs), shapes = shapes, scale = params$scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
4: em_fit(shapes, list(probs = as.list(probs), scale = scale))
5: .erlang_shape_search(obs = obs, probs = probs, shapes = shapes, scale = scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
6: fit_erlang_mixture(dist, x, init = "kmeans")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
fit_dist 4.522 0.063 6.869
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 0.0.2
Check: tests
Result: ERROR
Running ‘testthat.R’ [7s/9s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(reservr)
>
> test_check("reservr")
── Skip ('/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/reservr.Rcheck/tests/testthat/helpers.R:13:3'): set floatx to 64-bit ──
Reason: TensorFlow not available for testing
*** caught segfault ***
address 0x1, cause 'memory not mapped'
Traceback:
1: pgamma_diff_matrix(obs$xmin[i_cens], obs$xmax[i_cens], shapes, scale)
2: .erlang_dens_mat(obs, shapes, scale, i_obs, i_cens)
3: .erlang_em(obs = obs, probs = as.numeric(params$probs), shapes = shapes, scale = params$scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
4: em_fit(shapes, list(probs = as.list(probs), scale = scale))
5: .erlang_shape_search(obs = obs, probs = probs, shapes = shapes, scale = scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
6: fit_dist.ErlangMixtureDistribution(dist = object, obs = obs, start = start, ...)
7: fit_dist(dist = object, obs = obs, start = start, ...)
8: fit.Distribution(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
9: fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
10: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
11: withVisible(code)
12: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
13: force(code)
14: withr::with_output_sink(path, withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message))
15: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), ...)
16: quasi_capture(enquo(object), NULL, evaluate_promise)
17: expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes)))
18: eval(code, test_env)
19: eval(code, test_env)
20: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
21: doTryCatch(return(expr), name, parentenv, handler)
22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
23: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
24: doTryCatch(return(expr), name, parentenv, handler)
25: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
26: tryCatchList(expr, classes, parentenv, handlers)
27: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
28: test_code(desc, code, env = parent.frame(), default_reporter = local_interactive_reporter())
29: test_that("erlang mixture distribution works", { set.seed(1337L) dist <- dist_erlangmix(list(NULL, NULL, NULL)) params <- list(shapes = list(1L, 4L, 12L), scale = 2, probs = list(0.5, 0.3, 0.2)) alt_params <- list(shapes = list(2L, 6L, 100L), scale = 0.1, probs = list(0.7, 0.2, 0.1)) x <- dist$sample(100L, with_params = params) expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes))) expect_silent(fit(dist, x, init = "fan", spread = 3L)) expect_silent(fit(dist, x, init = "kmeans")) expect_silent(fit(dist, x, init = "cmm")) expect_identical(dist$get_type(), "continuous") expect_density(dist, function(x, log = FALSE, ...) { params <- list(...) res <- (params$probs[[1L]] * dgamma(x, shape = params$shapes[[1L]], scale = params$scale) + params$probs[[2L]] * dgamma(x, shape = params$shapes[[2L]], scale = params$scale) + params$probs[[3L]] * dgamma(x, shape = params$shapes[[3L]], scale = params$scale))/sum(as.numeric(params$probs)) if (log) log(res) else res }, params, x) expect_probability(dist, function(q, lower.tail = TRUE, log.p = FALSE, ...) { params <- list(...) res <- (params$probs[[1L]] * pgamma(q, shape = params$shapes[[1L]], scale = params$scale, lower.tail = lower.tail) + params$probs[[2L]] * pgamma(q, shape = params$shapes[[2L]], scale = params$scale, lower.tail = lower.tail) + params$probs[[3L]] * pgamma(q, shape = params$shapes[[3L]], scale = params$scale, lower.tail = lower.tail))/sum(as.numeric(params$probs)) if (log.p) log(res) else res }, params, x) expect_identical(dist$is_in_support(x), rep_len(TRUE, length(x))) expect_diff_density(dist, x, params) expect_diff_density(dist, x, alt_params) expect_tf_logdensity(dist, params, x) expect_tf_logdensity(dist, alt_params, x, tolerance = 1e-05) expect_tf_logprobability(dist, params, x, x + 1) expect_tf_logprobability(dist, params, x, rep_len(Inf, 100L)) expect_tf_logprobability(dist, params, rep_len(0, 100L), x) x_alt <- dist$sample(100L, with_params = alt_params) expect_tf_logprobability(dist, alt_params, x_alt, x_alt + 1) expect_iprobability(dist, params, x, x + 1) expect_iprobability(dist, params, 0, x) expect_iprobability(dist, params, x, Inf) dist$default_params$shapes <- params$shapes expect_tf_fit(dist, params[c("scale", "probs")], I_POSITIVE_REALS)})
30: eval(code, test_env)
31: eval(code, test_env)
32: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
33: doTryCatch(return(expr), name, parentenv, handler)
34: tryCatchOne(expr, names, parentenv, handlers[[1L]])
35: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
36: doTryCatch(return(expr), name, parentenv, handler)
37: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
38: tryCatchList(expr, classes, parentenv, handlers)
39: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
40: test_code(test = NULL, code = exprs, env = env, default_reporter = StopReporter$new())
41: source_file(path, env = env(env), desc = desc, error_call = error_call)
42: FUN(X[[i]], ...)
43: lapply(test_paths, test_one_file, env = env, desc = desc, 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, 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, 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)
51: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
52: test_check("reservr")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 0.0.2
Check: examples
Result: ERROR
Running examples in ‘reservr-Ex.R’ failed
The error most likely occurred in:
> ### Name: fit_erlang_mixture
> ### Title: Fit an Erlang mixture using an ECME-Algorithm
> ### Aliases: fit_erlang_mixture
>
> ### ** Examples
>
> dist <- dist_erlangmix(list(NULL, NULL, NULL))
> params <- list(
+ shapes = list(1L, 4L, 12L),
+ scale = 2.0,
+ probs = list(0.5, 0.3, 0.2)
+ )
> x <- dist$sample(100L, with_params = params)
> fit_erlang_mixture(dist, x, init = "kmeans")
*** caught segfault ***
address 0x1, cause 'memory not mapped'
Traceback:
1: pgamma_diff_matrix(obs$xmin[i_cens], obs$xmax[i_cens], shapes, scale)
2: .erlang_dens_mat(obs, shapes, scale, i_obs, i_cens)
3: .erlang_em(obs = obs, probs = as.numeric(params$probs), shapes = shapes, scale = params$scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
4: em_fit(shapes, list(probs = as.list(probs), scale = scale))
5: .erlang_shape_search(obs = obs, probs = probs, shapes = shapes, scale = scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
6: fit_erlang_mixture(dist, x, init = "kmeans")
An irrecoverable exception occurred. R is aborting now ...
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc
Version: 0.0.2
Check: tests
Result: ERROR
Running ‘testthat.R’ [13s/34s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(reservr)
>
> test_check("reservr")
── Skip ('/data/gannet/ripley/R/packages/tests-clang/reservr.Rcheck/tests/testthat/helpers.R:13:3'): set floatx to 64-bit ──
Reason: TensorFlow not available for testing
*** caught segfault ***
address 0x1, cause 'memory not mapped'
Traceback:
1: pgamma_diff_matrix(obs$xmin[i_cens], obs$xmax[i_cens], shapes, scale)
2: .erlang_dens_mat(obs, shapes, scale, i_obs, i_cens)
3: .erlang_em(obs = obs, probs = as.numeric(params$probs), shapes = shapes, scale = params$scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
4: em_fit(shapes, list(probs = as.list(probs), scale = scale))
5: .erlang_shape_search(obs = obs, probs = probs, shapes = shapes, scale = scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
6: fit_dist.ErlangMixtureDistribution(dist = object, obs = obs, start = start, ...)
7: fit_dist(dist = object, obs = obs, start = start, ...)
8: fit.Distribution(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
9: fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
10: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
11: withVisible(code)
12: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
13: force(code)
14: withr::with_output_sink(path, withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message))
15: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), ...)
16: quasi_capture(enquo(object), NULL, evaluate_promise)
17: expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes)))
18: eval(code, test_env)
19: eval(code, test_env)
20: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
21: doTryCatch(return(expr), name, parentenv, handler)
22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
23: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
24: doTryCatch(return(expr), name, parentenv, handler)
25: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
26: tryCatchList(expr, classes, parentenv, handlers)
27: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
28: test_code(desc, code, env = parent.frame(), default_reporter = local_interactive_reporter())
29: test_that("erlang mixture distribution works", { set.seed(1337L) dist <- dist_erlangmix(list(NULL, NULL, NULL)) params <- list(shapes = list(1L, 4L, 12L), scale = 2, probs = list(0.5, 0.3, 0.2)) alt_params <- list(shapes = list(2L, 6L, 100L), scale = 0.1, probs = list(0.7, 0.2, 0.1)) x <- dist$sample(100L, with_params = params) expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes))) expect_silent(fit(dist, x, init = "fan", spread = 3L)) expect_silent(fit(dist, x, init = "kmeans")) expect_silent(fit(dist, x, init = "cmm")) expect_identical(dist$get_type(), "continuous") expect_density(dist, function(x, log = FALSE, ...) { params <- list(...) res <- (params$probs[[1L]] * dgamma(x, shape = params$shapes[[1L]], scale = params$scale) + params$probs[[2L]] * dgamma(x, shape = params$shapes[[2L]], scale = params$scale) + params$probs[[3L]] * dgamma(x, shape = params$shapes[[3L]], scale = params$scale))/sum(as.numeric(params$probs)) if (log) log(res) else res }, params, x) expect_probability(dist, function(q, lower.tail = TRUE, log.p = FALSE, ...) { params <- list(...) res <- (params$probs[[1L]] * pgamma(q, shape = params$shapes[[1L]], scale = params$scale, lower.tail = lower.tail) + params$probs[[2L]] * pgamma(q, shape = params$shapes[[2L]], scale = params$scale, lower.tail = lower.tail) + params$probs[[3L]] * pgamma(q, shape = params$shapes[[3L]], scale = params$scale, lower.tail = lower.tail))/sum(as.numeric(params$probs)) if (log.p) log(res) else res }, params, x) expect_identical(dist$is_in_support(x), rep_len(TRUE, length(x))) expect_diff_density(dist, x, params) expect_diff_density(dist, x, alt_params) expect_tf_logdensity(dist, params, x) expect_tf_logdensity(dist, alt_params, x, tolerance = 1e-05) expect_tf_logprobability(dist, params, x, x + 1) expect_tf_logprobability(dist, params, x, rep_len(Inf, 100L)) expect_tf_logprobability(dist, params, rep_len(0, 100L), x) x_alt <- dist$sample(100L, with_params = alt_params) expect_tf_logprobability(dist, alt_params, x_alt, x_alt + 1) expect_iprobability(dist, params, x, x + 1) expect_iprobability(dist, params, 0, x) expect_iprobability(dist, params, x, Inf) dist$default_params$shapes <- params$shapes expect_tf_fit(dist, params[c("scale", "probs")], I_POSITIVE_REALS)})
30: eval(code, test_env)
31: eval(code, test_env)
32: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
33: doTryCatch(return(expr), name, parentenv, handler)
34: tryCatchOne(expr, names, parentenv, handlers[[1L]])
35: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
36: doTryCatch(return(expr), name, parentenv, handler)
37: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
38: tryCatchList(expr, classes, parentenv, handlers)
39: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
40: test_code(test = NULL, code = exprs, env = env, default_reporter = StopReporter$new())
41: source_file(path, env = env(env), desc = desc, error_call = error_call)
42: FUN(X[[i]], ...)
43: lapply(test_paths, test_one_file, env = env, desc = desc, 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, 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, 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)
51: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
52: test_check("reservr")
An irrecoverable exception occurred. R is aborting now ...
Flavor: r-devel-linux-x86_64-fedora-clang
Version: 0.0.2
Check: tests
Result: ERROR
Running ‘testthat.R’ [12s/22s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(reservr)
>
> test_check("reservr")
── Skip ('/data/gannet/ripley/R/packages/tests-devel/reservr.Rcheck/tests/testthat/helpers.R:13:3'): set floatx to 64-bit ──
Reason: TensorFlow not available for testing
*** caught segfault ***
address 0x1, cause 'memory not mapped'
Traceback:
1: pgamma_diff_matrix(obs$xmin[i_cens], obs$xmax[i_cens], shapes, scale)
2: .erlang_dens_mat(obs, shapes, scale, i_obs, i_cens)
3: .erlang_em(obs = obs, probs = as.numeric(params$probs), shapes = shapes, scale = params$scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
4: em_fit(shapes, list(probs = as.list(probs), scale = scale))
5: .erlang_shape_search(obs = obs, probs = probs, shapes = shapes, scale = scale, min_iter = min_iter, max_iter = max_iter, skip_first_e = skip_first_e, tolerance = tolerance, trace = trace, parallel = parallel)
6: fit_dist.ErlangMixtureDistribution(dist = object, obs = obs, start = start, ...)
7: fit_dist(dist = object, obs = obs, start = start, ...)
8: fit.Distribution(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
9: fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
10: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
11: withVisible(code)
12: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
13: force(code)
14: withr::with_output_sink(path, withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message))
15: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), ...)
16: quasi_capture(enquo(object), NULL, evaluate_promise)
17: expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes)))
18: eval(code, test_env)
19: eval(code, test_env)
20: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
21: doTryCatch(return(expr), name, parentenv, handler)
22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
23: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
24: doTryCatch(return(expr), name, parentenv, handler)
25: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
26: tryCatchList(expr, classes, parentenv, handlers)
27: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
28: test_code(desc, code, env = parent.frame(), default_reporter = local_interactive_reporter())
29: test_that("erlang mixture distribution works", { set.seed(1337L) dist <- dist_erlangmix(list(NULL, NULL, NULL)) params <- list(shapes = list(1L, 4L, 12L), scale = 2, probs = list(0.5, 0.3, 0.2)) alt_params <- list(shapes = list(2L, 6L, 100L), scale = 0.1, probs = list(0.7, 0.2, 0.1)) x <- dist$sample(100L, with_params = params) expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes))) expect_silent(fit(dist, x, init = "fan", spread = 3L)) expect_silent(fit(dist, x, init = "kmeans")) expect_silent(fit(dist, x, init = "cmm")) expect_identical(dist$get_type(), "continuous") expect_density(dist, function(x, log = FALSE, ...) { params <- list(...) res <- (params$probs[[1L]] * dgamma(x, shape = params$shapes[[1L]], scale = params$scale) + params$probs[[2L]] * dgamma(x, shape = params$shapes[[2L]], scale = params$scale) + params$probs[[3L]] * dgamma(x, shape = params$shapes[[3L]], scale = params$scale))/sum(as.numeric(params$probs)) if (log) log(res) else res }, params, x) expect_probability(dist, function(q, lower.tail = TRUE, log.p = FALSE, ...) { params <- list(...) res <- (params$probs[[1L]] * pgamma(q, shape = params$shapes[[1L]], scale = params$scale, lower.tail = lower.tail) + params$probs[[2L]] * pgamma(q, shape = params$shapes[[2L]], scale = params$scale, lower.tail = lower.tail) + params$probs[[3L]] * pgamma(q, shape = params$shapes[[3L]], scale = params$scale, lower.tail = lower.tail))/sum(as.numeric(params$probs)) if (log.p) log(res) else res }, params, x) expect_identical(dist$is_in_support(x), rep_len(TRUE, length(x))) expect_diff_density(dist, x, params) expect_diff_density(dist, x, alt_params) expect_tf_logdensity(dist, params, x) expect_tf_logdensity(dist, alt_params, x, tolerance = 1e-05) expect_tf_logprobability(dist, params, x, x + 1) expect_tf_logprobability(dist, params, x, rep_len(Inf, 100L)) expect_tf_logprobability(dist, params, rep_len(0, 100L), x) x_alt <- dist$sample(100L, with_params = alt_params) expect_tf_logprobability(dist, alt_params, x_alt, x_alt + 1) expect_iprobability(dist, params, x, x + 1) expect_iprobability(dist, params, 0, x) expect_iprobability(dist, params, x, Inf) dist$default_params$shapes <- params$shapes expect_tf_fit(dist, params[c("scale", "probs")], I_POSITIVE_REALS)})
30: eval(code, test_env)
31: eval(code, test_env)
32: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
33: doTryCatch(return(expr), name, parentenv, handler)
34: tryCatchOne(expr, names, parentenv, handlers[[1L]])
35: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
36: doTryCatch(return(expr), name, parentenv, handler)
37: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
38: tryCatchList(expr, classes, parentenv, handlers)
39: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
40: test_code(test = NULL, code = exprs, env = env, default_reporter = StopReporter$new())
41: source_file(path, env = env(env), desc = desc, error_call = error_call)
42: FUN(X[[i]], ...)
43: lapply(test_paths, test_one_file, env = env, desc = desc, 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, 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, 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)
51: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
52: test_check("reservr")
An irrecoverable exception occurred. R is aborting now ...
Flavor: r-devel-linux-x86_64-fedora-gcc
Version: 0.0.2
Check: examples
Result: ERROR
Running examples in 'reservr-Ex.R' failed
The error most likely occurred in:
> ### Name: fit_erlang_mixture
> ### Title: Fit an Erlang mixture using an ECME-Algorithm
> ### Aliases: fit_erlang_mixture
>
> ### ** Examples
>
> dist <- dist_erlangmix(list(NULL, NULL, NULL))
> params <- list(
+ shapes = list(1L, 4L, 12L),
+ scale = 2.0,
+ probs = list(0.5, 0.3, 0.2)
+ )
> x <- dist$sample(100L, with_params = params)
> fit_erlang_mixture(dist, x, init = "kmeans")
Flavor: r-devel-windows-x86_64
Version: 0.0.2
Check: tests
Result: ERROR
Running 'testthat.R' [17s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> library(testthat)
> library(reservr)
>
> test_check("reservr")
── Skip ('D:\RCompile\CRANpkg\local\4.5\reservr.Rcheck\tests\testthat\helpers.R:13:3'): set floatx to 64-bit ──
Reason: TensorFlow not available for testing
Flavor: r-devel-windows-x86_64
Version: 0.0.2
Check: installed package size
Result: NOTE
installed size is 16.1Mb
sub-directories of 1Mb or more:
R 2.1Mb
libs 13.5Mb
Flavors: r-release-macos-arm64, r-release-macos-x86_64, r-oldrel-macos-arm64, r-oldrel-macos-x86_64