Skip to content

Commit

Permalink
Merge branch 'release/0.12.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
BHGC Website GHA Workflow Runner committed Dec 20, 2023
2 parents ead3177 + 2ba72dd commit 60bd477
Show file tree
Hide file tree
Showing 18 changed files with 330 additions and 221 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
- {os: macOS-latest, r: 'devel' }
- {os: macOS-latest, r: 'release' }
- {os: macOS-latest, r: 'oldrel' }
- {os: ubuntu-20.04, r: 'devel' }
- {os: ubuntu-20.04, r: 'release' }
- {os: ubuntu-20.04, r: 'oldrel' }
- {os: ubuntu-20.04, r: 'oldrel-1' }
- {os: ubuntu-20.04, r: 'oldrel-2' }
- {os: ubuntu-20.04, r: '3.4' }
- {os: ubuntu-20.04, r: 'release' , language: ko, label: ko }
- {os: ubuntu-20.04, r: 'release' , language: zh_CN, label: zh_CN }
- {os: ubuntu-20.04, r: 'release' , language: zh_TW, label: zh_TW }
- {os: ubuntu-22.04, r: 'devel' }
- {os: ubuntu-22.04, r: 'release' }
- {os: ubuntu-22.04, r: 'oldrel' }
- {os: ubuntu-22.04, r: 'oldrel-1' }
- {os: ubuntu-22.04, r: 'oldrel-2' }
- {os: ubuntu-22.04, r: '3.6' }
- {os: ubuntu-22.04, r: 'release' , language: ko, label: ko }
- {os: ubuntu-22.04, r: 'release' , language: zh_CN, label: zh_CN }
- {os: ubuntu-22.04, r: 'release' , language: zh_TW, label: zh_TW }
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
Expand All @@ -47,7 +47,7 @@ jobs:
LANGUAGE: ${{ matrix.config.language }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/covr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

timeout-minutes: 20

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

name: covr

Expand All @@ -17,7 +17,7 @@ jobs:

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
## R CMD check
_R_CHECK_LENGTH_1_CONDITION_: true
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/future_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@ jobs:

timeout-minutes: 30

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

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

strategy:
fail-fast: false
matrix:
future:
- { plan: 'future.batchtools::batchtools_local' }
- { plan: 'future.batchtools::batchtools_local' }
- { plan: 'future.batchtools::batchtools_multicore' }
- { plan: 'future.batchtools::batchtools_bash' }
- { plan: 'future.batchtools::batchtools_interactive' }

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
## R CMD check
_R_CHECK_LENGTH_1_CONDITION_: true
Expand All @@ -32,7 +34,7 @@ jobs:
R_FUTURE_RNG_ONMISUSE: error

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

Expand Down
4 changes: 2 additions & 2 deletions .make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,12 @@ test_files: $(R_OUTDIR)/tests/*.R

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

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


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: future.batchtools
Version: 0.12.0
Version: 0.12.1
Depends:
R (>= 3.2.0),
parallelly,
future (>= 1.31.0)
Imports:
batchtools (>= 0.9.13),
batchtools (>= 0.9.16),
utils
Suggests:
globals,
Expand All @@ -16,8 +16,10 @@ Suggests:
VignetteBuilder:
R.rsp
Title: A Future API for Parallel and Distributed Processing using 'batchtools'
Authors@R: c(person("Henrik", "Bengtsson", role=c("aut", "cre", "cph"),
email = "[email protected]"))
Authors@R: c(person("Henrik", "Bengtsson",
role = c("aut", "cre", "cph"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-7579-5165")))
Description: Implementation of the Future API on top of the 'batchtools' package.
This allows you to process futures, as defined by the 'future' package,
in parallel out of the box, not only on your local machine or ad-hoc
Expand Down
12 changes: 10 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Version 0.12.1 [2023-12-19]

## Bug Fixes

* `plan(batchtools_multicore)` did not support `workers` argument
being a function.


# Version 0.12.0 [2023-02-24]

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

## Bug Fixes

Expand Down
1 change: 1 addition & 0 deletions R/BatchtoolsFuture-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ loggedError <- function(...) UseMethod("loggedError")


#' @importFrom batchtools getErrorMessages
#' @rdname loggedOutput
#' @export
loggedError.BatchtoolsFuture <- function(future, ...) {
stat <- status(future)
Expand Down
6 changes: 5 additions & 1 deletion R/batchtools_multicore.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ batchtools_multicore <- function(expr, envir = parent.frame(),
registry = list(), ...) {
if (substitute) expr <- substitute(expr)

if (is.null(workers)) workers <- availableCores(constraints = "multicore")
if (is.null(workers)) {
workers <- availableCores(constraints = "multicore")
} else if (is.function(workers)) {
workers <- workers()
}
stop_if_not(length(workers) == 1L, is.numeric(workers),
is.finite(workers), workers >= 1L)

Expand Down
2 changes: 2 additions & 0 deletions R/nbrOfWorkers.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ nbrOfWorkers.batchtools <- function(evaluator) {
expr <- formals(evaluator)$workers
workers <- eval(expr, enclos = baseenv())
if (!is.null(workers)) {
if (is.function(workers)) workers <- workers()
stop_if_not(length(workers) >= 1)
if (is.numeric(workers)) return(prod(workers))
if (is.character(workers)) return(length(workers))
Expand Down Expand Up @@ -57,6 +58,7 @@ nbrOfWorkers.batchtools_multicore <- function(evaluator) {
## 1. Infer from 'workers' argument
expr <- formals(evaluator)$workers
workers <- eval(expr, enclos = baseenv())
if (is.function(workers)) workers <- workers()
stop_if_not(length(workers) == 1L, is.numeric(workers), !is.na(workers), is.finite(workers), workers >= 1)
workers
}
Expand Down
3 changes: 2 additions & 1 deletion R/waitForWorker.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ waitForWorker.BatchtoolsFuture <- function(future,
await = NULL,
timeout = getOption("future.wait.timeout", 30 * 24 * 60 * 60),
delta = getOption("future.wait.interval", 0.2),
alpha = getOption("future.wait.alpha", 1.01)) {
alpha = getOption("future.wait.alpha", 1.01),
...) {
debug <- getOption("future.debug", FALSE)

stop_if_not(is.null(await) || is.function(await))
Expand Down
Loading

0 comments on commit 60bd477

Please sign in to comment.