Skip to content

Commit 63d70c7

Browse files
CLEANUP: Remove unused functions
1 parent 0e5cc95 commit 63d70c7

11 files changed

+29
-84
lines changed

.github/workflows/future_tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
matrix:
1818
future:
1919
- { plan: 'future.batchtools::batchtools_local' }
20+
- { plan: 'future.batchtools::batchtools_bash' }
2021

2122
env:
2223
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ spelling:
44
$(R_SCRIPT) -e "spelling::spell_check_files(c('NEWS', dir('vignettes', pattern='[.]rsp', full.names=TRUE)), ignore=readLines('inst/WORDLIST', warn=FALSE))"
55

66
future.tests/%:
7-
$(R_SCRIPT) -e "future.tests::check" --args --test-plan=$*
7+
$(R_SCRIPT) -e "future.tests::check" --args --test-plan="future.batchtools::$*"
88

9-
future.tests: future.tests/future.batchtools\:\:batchtools_local
9+
## batchtools_interactive is not 100% compliant (fails test 21. futureCall())
10+
future.tests: \
11+
future.tests/batchtools_local \
12+
future.tests/batchtools_bash
1013

1114
spelling:
1215
$(R_SCRIPT) -e "spelling::spell_check_package()"

NAMESPACE

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
S3method(add_finalizer,BatchtoolsFuture)
44
S3method(delete,BatchtoolsFuture)
55
S3method(launchFuture,BatchtoolsFutureBackend)
6-
S3method(listFutures,BatchtoolsSequentialFutureBackend)
6+
S3method(listFutures,BatchtoolsUniprocessFutureBackend)
77
S3method(loggedError,BatchtoolsFuture)
88
S3method(loggedOutput,BatchtoolsFuture)
9-
S3method(nbrOfFreeWorkers,BatchtoolsSequentialFutureBackend)
9+
S3method(nbrOfFreeWorkers,BatchtoolsUniprocessFutureBackend)
1010
S3method(nbrOfFreeWorkers,batchtools)
1111
S3method(nbrOfFreeWorkers,batchtools_multiprocess)
1212
S3method(nbrOfFreeWorkers,batchtools_uniprocess)
13-
S3method(nbrOfWorkers,BatchtoolsSequentialFutureBackend)
13+
S3method(nbrOfWorkers,BatchtoolsUniprocessFutureBackend)
1414
S3method(nbrOfWorkers,batchtools)
1515
S3method(nbrOfWorkers,batchtools_multicore)
1616
S3method(nbrOfWorkers,batchtools_uniprocess)
@@ -34,9 +34,7 @@ export(BatchtoolsCustomFuture)
3434
export(BatchtoolsFuture)
3535
export(BatchtoolsFutureBackend)
3636
export(BatchtoolsFutureError)
37-
export(BatchtoolsInteractiveFuture)
3837
export(BatchtoolsInteractiveFutureBackend)
39-
export(BatchtoolsLocalFuture)
4038
export(BatchtoolsLocalFutureBackend)
4139
export(BatchtoolsLsfFuture)
4240
export(BatchtoolsMulticoreFuture)
@@ -47,7 +45,6 @@ export(BatchtoolsSSHFuture)
4745
export(BatchtoolsSlurmFuture)
4846
export(BatchtoolsTemplateFuture)
4947
export(BatchtoolsTorqueFuture)
50-
export(BatchtoolsUniprocessFuture)
5148
export(batchtools_bash)
5249
export(batchtools_custom)
5350
export(batchtools_interactive)

R/BatchtoolsUniprocessFuture-class.R

-37
This file was deleted.

R/backend_api-BatchtoolsBashFutureBackend.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ BatchtoolsBashFutureBackend <- function(..., template = "bash", cluster.function
1212
)
1313

1414
core[["futureClasses"]] <- c("BatchtoolsBashFuture", core[["futureClasses"]])
15-
core <- structure(core, class = c("BatchtoolsBashFutureBackend", "BatchtoolsSequentialFutureBackend", setdiff(class(core), "MultiprocessFutureBackend")))
15+
core <- structure(core, class = c("BatchtoolsBashFutureBackend", "BatchtoolsUniprocessFutureBackend", setdiff(class(core), "MultiprocessFutureBackend")))
1616
core
1717
}
1818

1919

2020
#' @inheritParams batchtools_custom
2121
#' @inheritParams batchtools_template
22+
#' @param \ldots Additional arguments passed to [future::future()].
2223
#'
2324
#' @export
2425
batchtools_bash <- function(..., envir = parent.frame(), template = "bash") {

R/backend_api-BatchtoolsInteractiveFutureBackend.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ BatchtoolsInteractiveFutureBackend <- function(..., cluster.functions = NULL) {
99
)
1010

1111
core[["futureClasses"]] <- c("BatchtoolsInteractiveFuture", core[["futureClasses"]])
12-
core <- structure(core, class = c("BatchtoolsInteractiveFutureBackend", "BatchtoolsSequentialFutureBackend", setdiff(class(core), "MultiprocessFutureBackend")))
12+
core <- structure(core, class = c("BatchtoolsInteractiveFutureBackend", "BatchtoolsUniprocessFutureBackend", setdiff(class(core), "MultiprocessFutureBackend")))
1313
core
1414
}
1515

1616

17-
#' @inheritParams BatchtoolsUniprocessFuture
17+
#' @inheritParams BatchtoolsFuture
18+
#' @param \ldots Additional arguments passed to [future::future()].
1819
#'
1920
#' @importFrom batchtools makeClusterFunctionsInteractive
2021
#' @export

R/backend_api-BatchtoolsLocalFutureBackend.R

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#' @param \ldots Additional arguments passed to [BatchtoolsFutureBackend()].
2+
#'
13
#' @rdname BatchtoolsFutureBackend
24
#' @importFrom batchtools makeClusterFunctionsInteractive
35
#' @export
@@ -9,7 +11,7 @@ BatchtoolsLocalFutureBackend <- function(..., cluster.functions = NULL) {
911
)
1012

1113
core[["futureClasses"]] <- c("BatchtoolsLocalFuture", core[["futureClasses"]])
12-
core <- structure(core, class = c("BatchtoolsLocalFutureBackend", "BatchtoolsSequentialFutureBackend", setdiff(class(core), "MultiprocessFutureBackend")))
14+
core <- structure(core, class = c("BatchtoolsLocalFutureBackend", "BatchtoolsUniprocessFutureBackend", setdiff(class(core), "MultiprocessFutureBackend")))
1315
core
1416
}
1517

@@ -23,11 +25,12 @@ BatchtoolsLocalFutureBackend <- function(..., cluster.functions = NULL) {
2325
#' be assigned to the calling environment rather than to a local one).
2426
#' Both types of futures will block until the futures are resolved.
2527
#'
26-
#' @inheritParams BatchtoolsUniprocessFuture
27-
#'
28-
#' @param \ldots Additional arguments passed to [BatchtoolsUniprocessFuture()].
28+
#' @inheritParams BatchtoolsFuture
29+
#' @inheritParams BatchtoolsLocalFutureBackend
30+
#'
31+
#' @param \ldots Additional arguments passed to [future::future()].
2932
#'
30-
#' @return An object of class `BatchtoolsUniprocessFuture`.
33+
#' @return An object of class `BatchtoolsFuture`.
3134
#'
3235
#' @details
3336
#' batchtools local futures rely on the batchtools backend set up by

R/backend_api-BatchtoolsSequentialFutureBackend.R renamed to R/backend_api-BatchtoolsUniprocessFutureBackend.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
#' @export
2-
nbrOfWorkers.BatchtoolsSequentialFutureBackend <- function(evaluator) {
2+
nbrOfWorkers.BatchtoolsUniprocessFutureBackend <- function(evaluator) {
33
1L
44
}
55

66

77
#' @export
8-
nbrOfFreeWorkers.BatchtoolsSequentialFutureBackend <- function(evaluator, background = FALSE, ...) {
8+
nbrOfFreeWorkers.BatchtoolsUniprocessFutureBackend <- function(evaluator, background = FALSE, ...) {
99
assert_no_positional_args_but_first()
1010
if (isTRUE(background)) 0L else 1L
1111
}
1212

1313

1414
#' @importFrom future listFutures
1515
#' @export
16-
listFutures.BatchtoolsSequentialFutureBackend <- function(backend, ...) {
16+
listFutures.BatchtoolsUniprocessFutureBackend <- function(backend, ...) {
1717
data.frame(
1818
counter = integer(0L),
1919
start = proc.time()[[3]][integer(0L)],

man/BatchtoolsFuture.Rd

+1-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/BatchtoolsFutureBackend.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/batchtools_local.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)