Skip to content

Commit

Permalink
Remove append0()
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Dec 4, 2023
1 parent acc0f22 commit 46a60b4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 36 deletions.
2 changes: 0 additions & 2 deletions R/class_queue.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ queue_class <- R6::R6Class(
},
append = function(names, ranks = NULL) {
},
append0 = function(name) {
},
increment_ranks = function(names, by) {
},
should_dequeue = function() {
Expand Down
3 changes: 0 additions & 3 deletions R/class_sequential.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ sequential_class <- R6::R6Class(
append = function(names, ranks = NULL) {
self$data <- c(self$data, names)
},
append0 = function(name) {
self$data[length(self$data) + 1L] <- name
},
should_dequeue = function() {
self$is_nonempty()
},
Expand Down
25 changes: 0 additions & 25 deletions tests/testthat/test-class_parallel.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,31 +214,6 @@ tar_test("parallel$append() default ranks", {
)
})

tar_test("parallel$append0() something on an empty queue", {
q <- parallel_init()
q$append0(name = "a")
out <- q$data
exp <- 0L
names(exp) <- "a"
expect_identical(out, exp)
expect_equal(q$counter$count, 1L)
expect_equal(counter_get_names(q$counter), "a")
})

tar_test("parallel$append0() something on a nonempty queue", {
q <- parallel_init(names = c("x", "y"), ranks = c(2L, 3L))
q$append0(name = "a")
out <- q$data
exp <- c(2L, 3L, 0L)
names(exp) <- c("x", "y", "a")
expect_identical(out, exp)
expect_equal(q$counter$count, 3L)
expect_equal(
sort(counter_get_names(q$counter)),
sort(c("a", "x", "y"))
)
})

tar_test("parallel$increment_ranks() elementwise", {
q <- parallel_init(names = c("x", "y", "z"), ranks = seq_len(3L))
q$increment_ranks(names = c("y", "z"), by = c(-2L, 2L))
Expand Down
6 changes: 0 additions & 6 deletions tests/testthat/test-class_sequential.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ tar_test("sequential$append()", {
expect_equal(q$data, c("a", "b", "c", "d"))
})

tar_test("sequential$append0()", {
q <- sequential_init(c("a", "b"))
q$append0(name = "c")
expect_equal(q$data, c("a", "b", "c"))
})

tar_test("sequential$increment_ranks()", {
q <- sequential_init(c("a", "b"))
q$increment_ranks("a", 1L)
Expand Down

0 comments on commit 46a60b4

Please sign in to comment.