Skip to content

Commit 55d2530

Browse files
authored
Merge pull request #43 from osorensen/no-user-updates
fix: prevent users from entering at multiple timepoints across all da…
2 parents 634f73a + 706d4bf commit 55d2530

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

R/compute_sequentially.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ compute_sequentially <- function(
7272
stop("Something wrong with data")
7373
}
7474

75-
if(max(table(data$user)) > 1 &&
76-
attr(input_timeseries, "type") != "pairwise preferences") {
77-
stop("Updated users not supported.")
75+
# Check that each user appears at most once across all timepoints
76+
user_timepoint_combinations <- unique(data[c("user", "timepoint")])
77+
if(max(table(user_timepoint_combinations$user)) > 1) {
78+
stop("Each user can only enter the pool once. Users appearing at multiple timepoints: ",
79+
paste(names(table(user_timepoint_combinations$user))[table(user_timepoint_combinations$user) > 1],
80+
collapse = ", "))
7881
}
7982

8083
ret <- run_smc(input_timeseries, hyperparameters, smc_options,

0 commit comments

Comments
 (0)