Skip to content

Commit 913f3ec

Browse files
committed
closes #19
1 parent 71f9448 commit 913f3ec

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LinkingTo:
2020
Imports:
2121
Rcpp
2222
Depends:
23-
R (>= 2.10)
23+
R (>= 4.1.0)
2424
Suggests:
2525
testthat (>= 3.0.0),
2626
label.switching (>= 1.8)

R/compute_sequentially.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#' [precompute_topological_sorts()]. Only used with preference data, and
3030
#' defaults to `NULL`.
3131
#'
32-
#' @return An object
32+
#' @return An object of class BayesMallowsSMC2.
3333
#' @export
3434
#'
3535
compute_sequentially <- function(
@@ -79,5 +79,8 @@ compute_sequentially <- function(
7979

8080
ret <- run_smc(input_timeseries, hyperparameters, smc_options,
8181
sort_matrices, sort_counts)
82+
83+
class(ret) <- "BayesMallowsSMC2"
84+
ret
8285
}
8386

man/compute_sequentially.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-compute_sequentially_complete.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_that("compute_sequentially works with complete data", {
55
hyperparameters = set_hyperparameters(n_items = 5),
66
smc_options = set_smc_options(n_particles = 100, n_particle_filters = 1)
77
)
8+
expect_s3_class(mod, "BayesMallowsSMC2")
89
alpha_hat <- weighted.mean(x = as.numeric(mod$alpha), w = mod$importance_weights)
910
expect_gt(alpha_hat, .99)
1011
expect_lt(alpha_hat, 1.05)

0 commit comments

Comments
 (0)