Skip to content

Commit 0f68027

Browse files
Merge branch 'release/1.1.2'
2 parents c521a85 + 258f440 commit 0f68027

File tree

14 files changed

+206
-168
lines changed

14 files changed

+206
-168
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
on: [push, pull_request]
1+
on: [push, pull_request, workflow_dispatch]
22

33
name: R-CMD-check
44

@@ -20,6 +20,8 @@ jobs:
2020
- {os: windows-latest, r: 'release' }
2121
- {os: windows-latest, r: 'oldrel' }
2222
# - {os: macOS-latest, r: 'devel' }
23+
- {os: macOS-latest, r: 'release', parallelly_version: ed860db, label: 'w/ compatible parallelly' }
24+
- {os: macOS-latest, r: 'release', parallelly_version: ea182e9, label: 'w/ compatible parallelly' }
2325
- {os: macOS-latest, r: 'release' }
2426
- {os: macOS-latest, r: 'oldrel' }
2527
# - {os: ubuntu-latest, r: 'devel' }
@@ -75,18 +77,21 @@ jobs:
7577
run: |
7678
install.packages(".", repos = NULL, type = "source") ## needed by parallel workers
7779
lapply(c("future.batchtools", "future.callr"), FUN = function(pkg) if (grepl(pkg, "${{ matrix.config.future_plan }}")) install.packages(pkg))
78-
remotes::install_github("futureverse/parallelly", ref="develop")
7980
shell: Rscript {0}
8081

8182
- name: Test with specific future version?
8283
run: |
8384
globals_version <- Sys.getenv("R_GLOBALS_VERSION")
8485
if (nzchar(globals_version)) {
85-
remotes::install_github("futureverse/globals", ref=globals_version)
86+
remotes::install_github("futureverse/globals", ref=globals_version, upgrade = FALSE)
87+
}
88+
parallelly_version <- Sys.getenv("R_PARALLELLY_VERSION")
89+
if (nzchar(parallelly_version)) {
90+
remotes::install_github("futureverse/parallelly", ref=parallelly_version, upgrade = FALSE)
8691
}
8792
future_version <- Sys.getenv("R_FUTURE_VERSION")
8893
if (nzchar(future_version)) {
89-
remotes::install_github("futureverse/future", ref=future_version)
94+
remotes::install_github("futureverse/future", ref=future_version, upgrade = FALSE)
9095
}
9196
shell: Rscript {0}
9297

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: doFuture
2-
Version: 1.1.1
2+
Version: 1.1.2
33
Title: Use Foreach to Parallelize via the Future Framework
44
Depends:
55
foreach (>= 1.5.0),

NEWS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Version 1.1.2 (2025-07-14)
2+
3+
## Bug Fixes
4+
5+
* `with(registerDoFuture(), local = TRUE)` produced error on
6+
'argument "expr" is missing, with no default'.
7+
8+
* Environment variable `R_DOFUTURE_DEBUG` did not set R option
9+
`doFuture.debug` as documented.
10+
11+
112
# Version 1.1.1 (2025-06-06)
213

314
## Bug Fixes

R/globals.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ getGlobalsAndPackages_doFuture <- function(expr, envir, export = NULL, noexport
6363
stop("INTERNAL ERROR: Unknown value of 'globalsAs': ", sQuote(globalsAs))
6464
}
6565

66-
mstr(globals)
66+
if (debug) mstr(globals)
6767
stop_if_not("...future.x_ii" %in% names(globals))
6868

6969
names_globals <- names(globals)
@@ -83,7 +83,7 @@ getGlobalsAndPackages_doFuture <- function(expr, envir, export = NULL, noexport
8383
if (globalsAs != "manual") {
8484
globals2 <- setdiff(export, names_globals)
8585
if (length(globals2) > 0) {
86-
mdebugf(" - appending %d '.export' globals (not already found through automatic lookup): %s",
86+
if (debug) mdebugf(" - appending %d '.export' globals (not already found through automatic lookup): %s",
8787
length(globals2), paste(sQuote(globals2), collapse = ", "))
8888
gp <- getGlobalsAndPackages(expr, envir = globals_envir,
8989
globals = globals2)

R/utils-debug.R

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,67 +16,58 @@ debug_indent <- local({
1616
if (!exists(".debug", inherits = FALSE)) .debug <- new.env(parent = emptyenv())
1717
if (!"stack" %in% names(".debug")) .debug$stack <- list()
1818

19-
mdebug_push <- function(..., debug = isTRUE(getOption("doFuture.debug"))) {
20-
if (!debug) return()
21-
msg <- mdebug(..., debug = debug)
19+
mdebug_push <- function(...) {
20+
msg <- mdebug(...)
2221
.debug$stack <- c(.debug$stack, msg)
2322
invisible(msg)
2423
}
2524

26-
mdebugf_push <- function(..., debug = isTRUE(getOption("doFuture.debug"))) {
27-
if (!debug) return()
28-
msg <- mdebugf(..., debug = debug)
25+
mdebugf_push <- function(...) {
26+
msg <- mdebugf(...)
2927
.debug$stack <- c(.debug$stack, msg)
3028
invisible(msg)
3129
}
3230

33-
mdebug_pop <- function(..., debug = isTRUE(getOption("doFuture.debug"))) {
34-
if (!debug) return()
31+
mdebug_pop <- function(...) {
3532
n <- length(.debug$stack)
3633
msg <- c(...)
3734
if (length(msg) == 0) {
3835
msg <- .debug$stack[n]
3936
msg <- sprintf("%s done", msg)
4037
}
4138
.debug$stack <- .debug$stack[-n]
42-
if (length(msg) == 0 || !is.na(msg)) mdebug(msg, debug = debug)
39+
if (length(msg) == 0 || !is.na(msg)) mdebug(msg)
4340
}
4441

45-
mdebugf_pop <- function(..., debug = isTRUE(getOption("doFuture.debug"))) {
46-
if (!debug) return()
42+
mdebugf_pop <- function(...) {
4743
n <- length(.debug$stack)
4844
msg <- .debug$stack[n]
4945
.debug$stack <- .debug$stack[-n]
50-
mdebug(sprintf("%s done", msg), debug = debug)
46+
mdebug(sprintf("%s done", msg))
5147
}
5248

53-
mdebug <- function(..., prefix = now(), debug = isTRUE(getOption("doFuture.debug"))) {
54-
if (!debug) return()
49+
mdebug <- function(..., prefix = now()) {
5550
prefix <- paste(prefix, debug_indent(), sep = "")
5651
msg <- paste(..., sep = "")
5752
message(sprintf("%s%s", prefix, msg))
5853
invisible(msg)
5954
}
6055

61-
mdebugf <- function(..., appendLF = TRUE,
62-
prefix = now(), debug = isTRUE(getOption("doFuture.debug"))) {
63-
if (!debug) return()
56+
mdebugf <- function(..., appendLF = TRUE, prefix = now()) {
6457
prefix <- paste(prefix, debug_indent(), sep = "")
6558
msg <- sprintf(...)
6659
message(sprintf("%s%s", prefix, msg), appendLF = appendLF)
6760
invisible(msg)
6861
}
6962

7063
#' @importFrom utils capture.output
71-
mprint <- function(..., appendLF = TRUE, prefix = now(), debug = isTRUE(getOption("doFuture.debug"))) {
72-
if (!debug) return()
64+
mprint <- function(..., appendLF = TRUE, prefix = now()) {
7365
prefix <- paste(prefix, debug_indent(), sep = "")
7466
message(paste(prefix, capture.output(print(...)), sep = "", collapse = "\n"), appendLF = appendLF)
7567
}
7668

7769
#' @importFrom utils capture.output str
78-
mstr <- function(..., appendLF = TRUE, prefix = now(), debug = isTRUE(getOption("doFuture.debug"))) {
79-
if (!debug) return()
70+
mstr <- function(..., appendLF = TRUE, prefix = now()) {
8071
prefix <- paste(prefix, debug_indent(), sep = "")
8172
message(paste(prefix, capture.output(str(...)), sep = "", collapse = "\n"), appendLF = appendLF)
8273
}

R/with.DoPar.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#' @param \ldots Not used.
1717
#'
1818
#' @returns
19-
#' Invisibly, the value of `expr`.
19+
#' Invisibly, the value of `expr` if `local = FALSE`, other NULL.
2020
#'
2121
#' @example incl/with.R
2222
#'
@@ -38,9 +38,9 @@ with.DoPar <- function(data, expr, ..., local = FALSE, envir = parent.frame()) {
3838
call <- as.call(list(undoDoPar))
3939
args <- list(call, add = TRUE, after = TRUE)
4040
do.call(base::on.exit, args = args, envir = envir)
41+
invisible(NULL)
4142
} else {
4243
on.exit(undoDoPar())
44+
invisible(eval(expr, envir = envir, enclos = baseenv()))
4345
}
44-
45-
invisible(eval(expr, envir = envir, enclos = baseenv()))
4646
}

R/zzz.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ inRCmdCheck <- local({
6868
.onLoad <- function(libname, pkgname) {
6969
import_future_functions()
7070

71+
value <- getOption("doFuture.debug")
72+
if (is.null(value)) {
73+
value <- trim(Sys.getenv("R_DOFUTURE_DEBUG"))
74+
value <- isTRUE(as.logical(value))
75+
options(doFuture.debug = value)
76+
}
77+
7178
value <- getOption("doFuture.workarounds")
7279
if (is.null(value)) {
7380
value <- trim(Sys.getenv("R_DOFUTURE_WORKAROUNDS"))

inst/testme/test-with.DoPar.R

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#' @tags with
2+
#' @tags %dopar%
3+
#' @tags sequential multisession
4+
5+
library(doFuture)
6+
7+
foreach::registerDoSEQ()
8+
stopifnot(foreach::getDoParName() == "doSEQ")
9+
10+
with(registerDoFuture(), {
11+
stopifnot(foreach::getDoParName() == "doFuture")
12+
})
13+
stopifnot(foreach::getDoParName() == "doSEQ")
14+
15+
with(registerDoFuture("%dopar%"), {
16+
stopifnot(foreach::getDoParName() == "doFuture")
17+
})
18+
stopifnot(foreach::getDoParName() == "doSEQ")
19+
20+
with(registerDoFuture("%dofuture%"), {
21+
stopifnot(foreach::getDoParName() == "doFuture2")
22+
})
23+
stopifnot(foreach::getDoParName() == "doSEQ")
24+
25+
26+
local({
27+
with(registerDoFuture(), local = TRUE)
28+
stopifnot(foreach::getDoParName() == "doFuture")
29+
})
30+
stopifnot(foreach::getDoParName() == "doSEQ")
31+
32+
local({
33+
with(registerDoFuture("%dopar%"), local = TRUE)
34+
stopifnot(foreach::getDoParName() == "doFuture")
35+
})
36+
stopifnot(foreach::getDoParName() == "doSEQ")
37+
38+
local({
39+
with(registerDoFuture("%dofuture%"), local = TRUE)
40+
stopifnot(foreach::getDoParName() == "doFuture2")
41+
})
42+
stopifnot(foreach::getDoParName() == "doSEQ")

man/with.DoPar.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

revdep/README.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,36 @@
1010
|collate |en_US.UTF-8 |
1111
|ctype |en_US.UTF-8 |
1212
|tz |America/Los_Angeles |
13-
|date |2025-06-05 |
13+
|date |2025-07-14 |
1414
|pandoc |3.6.3 @ /software/c4/cbi/software/pandoc-3.6.3/bin/pandoc |
1515
|quarto |NA |
1616

1717
# Dependencies
1818

19-
|package |old |new |Δ |
20-
|:------------|:------|:----------|:--|
21-
|doFuture |1.1.0 |1.1.0-9004 |* |
22-
|codetools |0.2-20 |0.2-20 | |
23-
|digest |0.6.37 |0.6.37 | |
24-
|foreach |1.5.2 |1.5.2 | |
25-
|future |1.58.0 |1.58.0 | |
26-
|future.apply |1.11.3 |1.11.3 | |
27-
|globals |0.18.0 |0.18.0 | |
28-
|iterators |1.0.14 |1.0.14 | |
29-
|listenv |0.9.1 |0.9.1 | |
30-
|parallelly |1.45.0 |1.45.0 | |
19+
|package |old |new |Δ |
20+
|:------------|:------|:-----------|:--|
21+
|doFuture |1.1.1 |1.1.1-9005 |* |
22+
|codetools |0.2-20 |0.2-20 | |
23+
|digest |0.6.37 |0.6.37 | |
24+
|foreach |1.5.2 |1.5.2 | |
25+
|future |1.58.0 |1.58.0 | |
26+
|future.apply |1.20.0 |1.20.0 | |
27+
|globals |0.18.0 |0.18.0 | |
28+
|iterators |1.0.14 |1.0.14 | |
29+
|listenv |0.9.1 |0.9.1 | |
30+
|parallelly |1.45.0 |1.45.0-9012 |* |
3131

3232
# Revdeps
3333

34-
## Failed to check (2)
34+
## Failed to check (3)
3535

36-
|package |version |error |warning |note |
37-
|:----------|:-------|:-----|:-------|:----|
36+
|package |version |error |warning |note |
37+
|:---------------|:-------|:-----|:-------|:----|
3838
|[momentuHMM](failures.md#momentuhmm)|1.5.5 |1 | | |
3939
|[rechaRge](failures.md#recharge)|1.0.0 |1 | | |
40+
|[WeightedCluster](failures.md#weightedcluster)|1.8-1 |1 | | |
4041

41-
## All (62)
42+
## All (64)
4243

4344
|package |version |error |warning |note |
4445
|:-----------------|:-------|:-----|:-------|:----|
@@ -47,25 +48,26 @@
4748
|[baskexact](problems.md#baskexact)|1.0.1 | | |1 |
4849
|basksim |1.0.0 | | | |
4950
|BayesianMCPMod |1.1.0 | | | |
51+
|BayesRegDTR |1.0.1 | | | |
5052
|bhmbasket |0.9.5 | | | |
51-
|binaryRL |0.8.3 | | | |
53+
|binaryRL |0.9.0 | | | |
5254
|bsitar |0.3.2 | | | |
53-
|dbmss |2.10-0 | | | |
55+
|dbmss |2.11-0 | | | |
5456
|distantia |2.0.2 | | | |
5557
|[envi](problems.md#envi)|1.0.0 |1 | | |
5658
|[EQRN](problems.md#eqrn)|0.1.1 |1 |1 | |
57-
|fastml |0.5.0 | | | |
59+
|fastml |0.6.1 | | | |
5860
|flexFitR |1.2.0 | | | |
5961
|funGp |1.0.0 | | | |
6062
|futureverse |0.1.0 | | | |
6163
|fxTWAPLS |0.1.3 | | | |
62-
|[GeDS](problems.md#geds)|0.3.1 | |1 | |
63-
|GeoModels |2.1.5 | | | |
64+
|[GeDS](problems.md#geds)|0.3.3 | |1 | |
65+
|GeoModels |2.1.6 | | | |
6466
|[hwep](problems.md#hwep)|2.0.2 | | |1 |
6567
|[ISAnalytics](problems.md#isanalytics)|1.18.0 | | |1 |
6668
|jackknifeR |2.0.0 | | | |
6769
|kergp |0.5.8 | | | |
68-
|kernelshap |0.7.0 | | | |
70+
|kernelshap |0.8.0 | | | |
6971
|[latentcor](problems.md#latentcor)|2.0.1 | | |1 |
7072
|[ldsr](problems.md#ldsr)|0.0.2 | | |1 |
7173
|LWFBrook90R |0.6.2 | | | |
@@ -81,16 +83,16 @@
8183
|[pliman](problems.md#pliman)|3.0.0 |1 | | |
8284
|polykde |1.1.4 | | | |
8385
|progressr |0.15.1 | | | |
84-
|projpred |2.8.0 | | | |
86+
|projpred |2.9.0 | | | |
8587
|[rechaRge](failures.md#recharge)|1.0.0 |1 | | |
8688
|remiod |1.0.2 | | | |
8789
|robust2sls |0.2.3 | | | |
8890
|rpm |0.7-3 | | | |
8991
|SCdeconR |1.0.0 | | | |
90-
|segtest |1.0.2 | | | |
92+
|segtest |2.0.0 | | | |
9193
|semPower |2.1.1 | | | |
9294
|SharkDemography |1.1.0 | | | |
93-
|[simtrial](problems.md#simtrial)|0.4.2 | | |1 |
95+
|simtrial |1.0.0 | | | |
9496
|skpr |1.8.2 | | | |
9597
|[sparrpowR](problems.md#sparrpowr)|0.2.8 |1 | | |
9698
|sphunif |1.4.0 | | | |
@@ -101,7 +103,8 @@
101103
|[tglkmeans](problems.md#tglkmeans)|0.5.5 | | |1 |
102104
|tune |1.3.0 | | | |
103105
|updog |2.1.5 | | | |
106+
|vecmatch |1.2.0 | | | |
104107
|[vmeasur](problems.md#vmeasur)|0.1.4 | |1 | |
105-
|WARDEN |1.0 | | | |
106-
|[WeightedCluster](problems.md#weightedcluster)|1.8-1 | |1 | |
108+
|WARDEN |1.2.5 | | | |
109+
|[WeightedCluster](failures.md#weightedcluster)|1.8-1 |1 | | |
107110

0 commit comments

Comments
 (0)