Skip to content

Commit fce6213

Browse files
Merge branch 'release/1.20.1'
2 parents 40e8414 + 48c8eb7 commit fce6213

12 files changed

Lines changed: 697 additions & 1141 deletions

File tree

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- {os: macOS-latest, r: 'devel' }
2323
- {os: macOS-latest, r: 'release' }
2424
- {os: macOS-latest, r: 'oldrel' }
25-
# - {os: ubuntu-latest, r: 'devel' }
25+
- {os: ubuntu-latest, r: 'devel', strict: true, label: 'strict' }
2626
- {os: ubuntu-latest, r: 'release' }
2727
- {os: ubuntu-latest, r: 'oldrel' }
2828
- {os: ubuntu-latest, r: 'oldrel-1' }
@@ -31,9 +31,7 @@ jobs:
3131
- {os: ubuntu-latest, r: 'release' , language: ko, label: ko }
3232
- {os: ubuntu-latest, r: 'release' , globals_keepWhere: true, label: 'keepWhere' }
3333
- {os: ubuntu-latest, r: 'release' , globals_keepWhere: false, label: '!keepWhere' }
34-
- {os: windows-latest, r: 'devel', globals_version: develop, future_version: develop, label: 'w/ future-develop' }
3534
- {os: windows-latest, r: 'devel', future_version: develop, label: 'w/ future-develop' }
36-
- {os: ubuntu-latest, r: 'release', globals_version: develop, future_version: develop, label: 'w/ future-develop' }
3735
- {os: ubuntu-latest, r: 'release', future_version: develop, label: 'w/ future-develop' }
3836

3937
env:
@@ -107,6 +105,16 @@ jobs:
107105

108106
- name: Check
109107
run: |
108+
if ("${{ matrix.config.strict }}" == "true") {
109+
Sys.setenv(NOT_CRAN = "true")
110+
Sys.setenv(R_FUTURE_GLOBALENV_ONMISUSE = "error")
111+
Sys.setenv(R_FUTURE_RNG_ONMISUSE = "error")
112+
Sys.setenv(R_FUTURE_FUTURE_EARLYSIGNAL = "defunct")
113+
Sys.setenv(R_FUTURE_FUTURE_LOCAL = "defunct")
114+
Sys.setenv(R_FUTURE_FUTURE_GC = "defunct")
115+
Sys.setenv(R_FUTURE_PLAN_EARLYSIGNAL = "defunct")
116+
Sys.setenv(R_FUTURE_RESOLVED_RUN = "defunct")
117+
}
110118
if (nzchar(Sys.getenv("R_FUTURE_PLAN"))) Sys.setenv(RCMDCHECK_ERROR_ON = "error")
111119
rcmdcheck::rcmdcheck(
112120
args = c("--no-manual", "--as-cran"),

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.apply
2-
Version: 1.20.0
2+
Version: 1.20.1
33
Title: Apply Function to Elements in Parallel using Futures
44
Depends:
55
R (>= 3.2.0),
@@ -28,5 +28,5 @@ URL: https://future.apply.futureverse.org, https://github.com/futureverse/future
2828
BugReports: https://github.com/futureverse/future.apply/issues
2929
Language: en-US
3030
Encoding: UTF-8
31-
RoxygenNote: 7.3.2
31+
RoxygenNote: 7.3.3
3232
Roxygen: list(markdown = TRUE)

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Version 1.20.1 [2025-12-08]
2+
3+
## Bug Fixes
4+
5+
* `future_apply(..., future.globals = list(...))` would produce
6+
'Error in if (chunk_size > maxSize) { : missing value where
7+
TRUE/FALSE needed'.
8+
9+
110
# Version 1.20.0 [2025-06-06]
211

312
## Significant changes

R/future_apply.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ future_apply <- function(X, MARGIN, FUN, ..., simplify = TRUE, future.envir = pa
124124
nWorkers <- nbrOfWorkers()
125125
chunk_size <- size / nWorkers
126126
other_size <- attr(globals, "total_size")
127+
## Calculate size of the 'globals', if not already done
128+
if (is.na(other_size)) other_size <- objectSize(X)
127129
if (is.numeric(other_size)) chunk_size <- chunk_size + other_size
128130
if (chunk_size > maxSize) {
129131
asIEC <- import_future("asIEC")

R/future_lapply.R

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,27 @@
128128
#' reproducible given the same initial seed.
129129
#'
130130
#'
131+
#' @section Load balancing ("chunking"):
132+
#' Whether load balancing ("chunking") should take place or not can be
133+
#' controlled by specifying either argument
134+
#' `future.scheduling = <ratio>` or `future.chunk.size = <count>`.
135+
#'
136+
#' The value `future.chunk.size` specifies the average number of elements
137+
#' processed per future ("chunks").
138+
#' If `+Inf`, then all elements are processed in a single future (one worker).
139+
#' If `NULL`, then argument `future.scheduling` is used.
140+
#'
141+
#' The value `future.scheduling` specifies the average number of futures
142+
#' ("chunks") that each worker processes.
143+
#' If `0.0`, then a single future is used to process all iterations;
144+
#' none of the other workers are not used.
145+
#' If `1.0` or `TRUE`, then one future per worker is used.
146+
#' If `2.0`, then each worker will process two futures (if there are
147+
#' enough iterations).
148+
#' If `+Inf` or `FALSE`, then one future per iteration is used.
149+
#' The default value is `scheduling = 1.0`.
150+
#'
151+
#'
131152
#' @section Control processing order of elements:
132153
#' Attribute `ordering` of `future.chunk.size` or `future.scheduling` can
133154
#' be used to control the ordering the elements are iterated over, which
@@ -140,9 +161,10 @@
140161
#' `function(n) rev(seq_len(n))` for reverse ordering.
141162
#' * `"random"` - this will randomize the ordering via random index
142163
#' vector `sample.int(length(X))`.
164+
#'
143165
#' For example, `future.scheduling = structure(TRUE, ordering = "random")`.
144166
#' _Note_, when elements are processed out of order, then captured standard
145-
#' output and conditions are also relayed in that order, that is out of order.
167+
#' output and conditions are relayed in that order as well.
146168
#'
147169
#' @example incl/future_lapply.R
148170
#'

R/future_xapply.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @importFrom future cancel Future nbrOfWorkers future resolve value as.FutureGlobals getGlobalsAndPackages FutureInterruptError
1+
#' @importFrom future cancel Future nbrOfWorkers future resolve value as.FutureGlobals getGlobalsAndPackages
22
future_xapply <- local({
33
tmpl_expr_options <- bquote_compile({
44
"# future.apply:::future_xapply(): preserve future option"

man/future_lapply.Rd

Lines changed: 25 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)