Skip to content

Commit 60bd477

Browse files
author
BHGC Website GHA Workflow Runner
committed
Merge branch 'release/0.12.1'
2 parents ead3177 + 2ba72dd commit 60bd477

18 files changed

+330
-221
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
- {os: macOS-latest, r: 'devel' }
2323
- {os: macOS-latest, r: 'release' }
2424
- {os: macOS-latest, r: 'oldrel' }
25-
- {os: ubuntu-20.04, r: 'devel' }
26-
- {os: ubuntu-20.04, r: 'release' }
27-
- {os: ubuntu-20.04, r: 'oldrel' }
28-
- {os: ubuntu-20.04, r: 'oldrel-1' }
29-
- {os: ubuntu-20.04, r: 'oldrel-2' }
30-
- {os: ubuntu-20.04, r: '3.4' }
31-
- {os: ubuntu-20.04, r: 'release' , language: ko, label: ko }
32-
- {os: ubuntu-20.04, r: 'release' , language: zh_CN, label: zh_CN }
33-
- {os: ubuntu-20.04, r: 'release' , language: zh_TW, label: zh_TW }
25+
- {os: ubuntu-22.04, r: 'devel' }
26+
- {os: ubuntu-22.04, r: 'release' }
27+
- {os: ubuntu-22.04, r: 'oldrel' }
28+
- {os: ubuntu-22.04, r: 'oldrel-1' }
29+
- {os: ubuntu-22.04, r: 'oldrel-2' }
30+
- {os: ubuntu-22.04, r: '3.6' }
31+
- {os: ubuntu-22.04, r: 'release' , language: ko, label: ko }
32+
- {os: ubuntu-22.04, r: 'release' , language: zh_CN, label: zh_CN }
33+
- {os: ubuntu-22.04, r: 'release' , language: zh_TW, label: zh_TW }
3434
env:
3535
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3636
R_KEEP_PKG_SOURCE: yes
@@ -47,7 +47,7 @@ jobs:
4747
LANGUAGE: ${{ matrix.config.language }}
4848

4949
steps:
50-
- uses: actions/checkout@v3
50+
- uses: actions/checkout@v4
5151

5252
- uses: r-lib/actions/setup-pandoc@v2
5353

.github/workflows/covr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
timeout-minutes: 20
1010

11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-22.04
1212

1313
name: covr
1414

@@ -17,7 +17,7 @@ jobs:
1717

1818
env:
1919
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
20-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
20+
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
2121
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
2222
## R CMD check
2323
_R_CHECK_LENGTH_1_CONDITION_: true

.github/workflows/future_tests.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ jobs:
88

99
timeout-minutes: 30
1010

11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-22.04
1212

1313
name: future.plan=${{ matrix.future.plan }}
1414

1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
future:
19-
- { plan: 'future.batchtools::batchtools_local' }
19+
- { plan: 'future.batchtools::batchtools_local' }
20+
- { plan: 'future.batchtools::batchtools_multicore' }
21+
- { plan: 'future.batchtools::batchtools_bash' }
2022
- { plan: 'future.batchtools::batchtools_interactive' }
2123

2224
env:
2325
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
26+
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
2527
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
2628
## R CMD check
2729
_R_CHECK_LENGTH_1_CONDITION_: true
@@ -32,7 +34,7 @@ jobs:
3234
R_FUTURE_RNG_ONMISUSE: error
3335

3436
steps:
35-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3638

3739
- uses: r-lib/actions/setup-pandoc@v2
3840

.make/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,12 @@ test_files: $(R_OUTDIR)/tests/*.R
356356

357357
test: $(R_OUTDIR)/tests/%.R
358358
$(CD) $(R_OUTDIR)/tests;\
359-
$(R_SCRIPT) -e "for (f in list.files(pattern='[.]R$$')) { print(f); source(f, chdir=TRUE, echo=TRUE) }"
359+
$(R_SCRIPT) -e "for (f in list.files(pattern='[.]R$$')) { print(f); source(f, echo=TRUE) }"
360360

361361
test_full: $(R_OUTDIR)/tests/%.R
362362
$(CD) $(R_OUTDIR)/tests;\
363363
export _R_CHECK_FULL_=TRUE;\
364-
$(R_SCRIPT) -e "for (f in list.files(pattern='[.]R$$')) { print(f); source(f, chdir=TRUE, echo=TRUE) }"
364+
$(R_SCRIPT) -e "for (f in list.files(pattern='[.]R$$')) { print(f); source(f, echo=TRUE) }"
365365

366366

367367
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

DESCRIPTION

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: future.batchtools
2-
Version: 0.12.0
2+
Version: 0.12.1
33
Depends:
44
R (>= 3.2.0),
55
parallelly,
66
future (>= 1.31.0)
77
Imports:
8-
batchtools (>= 0.9.13),
8+
batchtools (>= 0.9.16),
99
utils
1010
Suggests:
1111
globals,
@@ -16,8 +16,10 @@ Suggests:
1616
VignetteBuilder:
1717
R.rsp
1818
Title: A Future API for Parallel and Distributed Processing using 'batchtools'
19-
Authors@R: c(person("Henrik", "Bengtsson", role=c("aut", "cre", "cph"),
20-
email = "[email protected]"))
19+
Authors@R: c(person("Henrik", "Bengtsson",
20+
role = c("aut", "cre", "cph"),
21+
email = "[email protected]",
22+
comment = c(ORCID = "0000-0002-7579-5165")))
2123
Description: Implementation of the Future API on top of the 'batchtools' package.
2224
This allows you to process futures, as defined by the 'future' package,
2325
in parallel out of the box, not only on your local machine or ad-hoc

NEWS.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Version 0.12.1 [2023-12-19]
2+
3+
## Bug Fixes
4+
5+
* `plan(batchtools_multicore)` did not support `workers` argument
6+
being a function.
7+
8+
19
# Version 0.12.0 [2023-02-24]
210

311
## New Features
@@ -76,8 +84,8 @@
7684
Because of this, we temporarily set `fs.latency = 1.0` (second)
7785
timeout for trying to find the log file. This makes a big
7886
difference in case the template used a `--output=<path>` location
79-
other than `--output=<%= log.file %>`l in such cases the log file
80-
would not be found, requiring a timeout.
87+
other than `--output=<%= log.file %>`. In such cases, the log file
88+
would not be found, requiring a full timeout to complete.
8189

8290
## Bug Fixes
8391

R/BatchtoolsFuture-class.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ loggedError <- function(...) UseMethod("loggedError")
294294

295295

296296
#' @importFrom batchtools getErrorMessages
297+
#' @rdname loggedOutput
297298
#' @export
298299
loggedError.BatchtoolsFuture <- function(future, ...) {
299300
stat <- status(future)

R/batchtools_multicore.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ batchtools_multicore <- function(expr, envir = parent.frame(),
3333
registry = list(), ...) {
3434
if (substitute) expr <- substitute(expr)
3535

36-
if (is.null(workers)) workers <- availableCores(constraints = "multicore")
36+
if (is.null(workers)) {
37+
workers <- availableCores(constraints = "multicore")
38+
} else if (is.function(workers)) {
39+
workers <- workers()
40+
}
3741
stop_if_not(length(workers) == 1L, is.numeric(workers),
3842
is.finite(workers), workers >= 1L)
3943

R/nbrOfWorkers.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ nbrOfWorkers.batchtools <- function(evaluator) {
1818
expr <- formals(evaluator)$workers
1919
workers <- eval(expr, enclos = baseenv())
2020
if (!is.null(workers)) {
21+
if (is.function(workers)) workers <- workers()
2122
stop_if_not(length(workers) >= 1)
2223
if (is.numeric(workers)) return(prod(workers))
2324
if (is.character(workers)) return(length(workers))
@@ -57,6 +58,7 @@ nbrOfWorkers.batchtools_multicore <- function(evaluator) {
5758
## 1. Infer from 'workers' argument
5859
expr <- formals(evaluator)$workers
5960
workers <- eval(expr, enclos = baseenv())
61+
if (is.function(workers)) workers <- workers()
6062
stop_if_not(length(workers) == 1L, is.numeric(workers), !is.na(workers), is.finite(workers), workers >= 1)
6163
workers
6264
}

R/waitForWorker.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ waitForWorker.BatchtoolsFuture <- function(future,
4444
await = NULL,
4545
timeout = getOption("future.wait.timeout", 30 * 24 * 60 * 60),
4646
delta = getOption("future.wait.interval", 0.2),
47-
alpha = getOption("future.wait.alpha", 1.01)) {
47+
alpha = getOption("future.wait.alpha", 1.01),
48+
...) {
4849
debug <- getOption("future.debug", FALSE)
4950

5051
stop_if_not(is.null(await) || is.function(await))

0 commit comments

Comments
 (0)