Skip to content

Commit defe3b7

Browse files
CLEANUP: Remove also finished() and status(), cf. Issue #58
1 parent e64b55b commit defe3b7

File tree

4 files changed

+31
-66
lines changed

4 files changed

+31
-66
lines changed

NAMESPACE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# Generated by roxygen2: do not edit by hand
22

33
S3method(delete,BatchtoolsFuture)
4-
S3method(finished,BatchtoolsFuture)
54
S3method(loggedError,BatchtoolsFuture)
65
S3method(loggedOutput,BatchtoolsFuture)
76
S3method(nbrOfWorkers,batchtools)
87
S3method(print,BatchtoolsFuture)
98
S3method(resolved,BatchtoolsFuture)
109
S3method(result,BatchtoolsFuture)
1110
S3method(run,BatchtoolsFuture)
12-
S3method(status,BatchtoolsFuture)
1311
export("%resources%")
1412
export(BatchtoolsFuture)
1513
export(BatchtoolsFutureError)
@@ -22,10 +20,8 @@ export(batchtools_openlava)
2220
export(batchtools_sge)
2321
export(batchtools_slurm)
2422
export(batchtools_torque)
25-
export(finished)
2623
export(loggedError)
2724
export(loggedOutput)
28-
export(status)
2925
importFrom(batchtools,batchExport)
3026
importFrom(batchtools,batchMap)
3127
importFrom(batchtools,clearRegistry)

NEWS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ SIGNIFICANT CHANGES:
88
* Lazy batchtools futures only creates the internal batchtools registry when
99
the future is launched.
1010

11-
* Removed S3 generic await(), which is a function that was only used for
12-
internal purposes.
11+
* Removed S3 generic functions await(), finished(), and status(), which were
12+
functions that were used for internal purposes.
1313

1414
DOCUMENTATION:
1515

@@ -23,8 +23,8 @@ BUG FIXES:
2323

2424
DEPRECATED AND DEFUNCT:
2525

26-
* Removed S3 generic await(), which is a function that was only used for
27-
internal purposes.
26+
* Removed S3 generic functions await(), finished(), and status(), which were
27+
functions that were used for internal purposes.
2828

2929

3030
Version: 0.9.0 [2020-04-14]

R/BatchtoolsFuture-class.R

Lines changed: 22 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -187,29 +187,8 @@ print.BatchtoolsFuture <- function(x, ...) {
187187
}
188188

189189

190-
status <- function(...) UseMethod("status")
191-
finished <- function(...) UseMethod("finished")
192-
loggedError <- function(...) UseMethod("loggedError")
193-
loggedOutput <- function(...) UseMethod("loggedOutput")
194-
195-
#' Status of batchtools future
196-
#'
197-
#' @param future The future.
198-
#' @param \ldots Not used.
199-
#'
200-
#' @return A character vector or a logical scalar.
201-
#'
202-
#' @aliases status finished result
203-
#' loggedError loggedOutput
204-
#' @keywords internal
205-
#'
206-
#' @export
207-
#' @export status
208-
#' @export finished
209-
#' @export loggedError
210-
#' @export loggedOutput
211190
#' @importFrom batchtools getStatus
212-
status.BatchtoolsFuture <- function(future, ...) {
191+
status <- function(future, ...) {
213192
debug <- getOption("future.debug", FALSE)
214193
if (debug) {
215194
mdebug("status() for ", class(future)[1], " ...")
@@ -258,16 +237,32 @@ status.BatchtoolsFuture <- function(future, ...) {
258237
}
259238

260239

261-
#' @export
262-
#' @keywords internal
263-
finished.BatchtoolsFuture <- function(future, ...) {
240+
finished <- function(future, ...) {
264241
status <- status(future)
265242
if (is_na(status)) return(NA)
266243
any(c("finished", "error", "expired") %in% status)
267244
}
268245

269-
#' @export
246+
247+
248+
#' Logged output of batchtools future
249+
#'
250+
#' @param future The future.
251+
#' @param \ldots Not used.
252+
#'
253+
#' @return A character vector or a logical scalar.
254+
#'
255+
#' @aliases loggedOutput loggedError
256+
#'
257+
#' @export loggedError
258+
#' @export loggedOutput
270259
#' @keywords internal
260+
loggedOutput <- function(...) UseMethod("loggedOutput")
261+
loggedError <- function(...) UseMethod("loggedError")
262+
263+
264+
#' @importFrom batchtools getErrorMessages
265+
#' @export
271266
loggedError.BatchtoolsFuture <- function(future, ...) {
272267
stat <- status(future)
273268
if (is_na(stat)) return(NULL)
@@ -294,7 +289,6 @@ loggedError.BatchtoolsFuture <- function(future, ...) {
294289

295290
#' @importFrom batchtools getLog
296291
#' @export
297-
#' @keywords internal
298292
loggedOutput.BatchtoolsFuture <- function(future, ...) {
299293
stat <- status(future)
300294
if (is_na(stat)) return(NULL)
@@ -502,29 +496,8 @@ run.BatchtoolsFuture <- function(future, ...) {
502496
} ## run()
503497

504498

505-
#' Awaits the value of a batchtools future
506-
#'
507-
#' @param future The future.
508-
#' @param cleanup If TRUE, the registry is completely removed upon
509-
#' success, otherwise not.
510-
#' @param timeout Total time (in seconds) waiting before generating an error.
511-
#' @param delta The number of seconds to wait between each poll.
512-
#' @param alpha A factor to scale up the waiting time in each iteration such
513-
#' that the waiting time in the k:th iteration is `alpha ^ k * delta`.
514-
#' @param \ldots Not used.
515-
#'
516-
#' @return The value of the evaluated expression.
517-
#' If an error occurs, an informative Exception is thrown.
518-
#'
519-
#' @details
520-
#' Note that `await()` should only be called once, because
521-
#' after being called the actual asynchronous future may be removed
522-
#' and will no longer available in subsequent calls. If called
523-
#' again, an error may be thrown.
524-
#'
525-
#' @importFrom batchtools getErrorMessages loadResult waitForJobs
499+
#' @importFrom batchtools loadResult waitForJobs
526500
#' @importFrom utils tail
527-
#' @keywords internal
528501
await <- function(future, cleanup = TRUE,
529502
timeout = getOption("future.wait.timeout", 30 * 24 * 60 * 60),
530503
delta = getOption("future.wait.interval", 1.0),
Lines changed: 5 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)