Skip to content

Commit aefdc95

Browse files
Inject string comments when building up future expressions
1 parent 494dd75 commit aefdc95

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

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.0.1-9010
2+
Version: 1.0.1-9011
33
Title: Use Foreach to Parallelize via the Future Framework
44
Depends:
55
foreach (>= 1.5.0),

R/doFuture.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ doFuture <- local({
1111
})
1212

1313
tmpl_expr <- bquote_compile({
14-
## Tell foreach to keep using futures also in nested calls
14+
"# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'
15+
"# also in nested calls"
1516
doFuture::registerDoFuture()
1617

18+
"# doFuture():::doFuture(): process chunk of elements"
1719
lapply(seq_along(...future.x_ii), FUN = function(jj) {
1820
...future.x_jj <- ...future.x_ii[[jj]] #nolint
1921
.(dummy_globals)
@@ -29,6 +31,7 @@ doFuture <- local({
2931
})
3032

3133
tmpl_expr_options <- bquote_compile({
34+
"# doFuture:::doFuture(): preserve future option"
3235
...future.globals.maxSize.org <- getOption("future.globals.maxSize")
3336
if (!identical(...future.globals.maxSize.org, ...future.globals.maxSize)) {
3437
oopts <- options(future.globals.maxSize = ...future.globals.maxSize)

R/dofuture_OP.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,8 @@ tmpl_dummy_globals <- bquote_compile({
867867

868868
tmpl_expr_with_rng <- bquote_compile({
869869
.(optional_patches)
870+
871+
"# doFuture():::doFuture2(): process chunk of elements"
870872
lapply(seq_along(...future.x_ii), FUN = function(jj) {
871873
...future.x_jj <- ...future.x_ii[[jj]] #nolint
872874
.(dummy_globals)
@@ -884,6 +886,7 @@ tmpl_expr_with_rng <- bquote_compile({
884886

885887

886888
tmpl_expr_options <- bquote_compile({
889+
"# doFuture:::doFuture2(): preserve future option"
887890
...future.globals.maxSize.org <- getOption("future.globals.maxSize")
888891
if (!identical(...future.globals.maxSize.org, ...future.globals.maxSize)) {
889892
oopts <- options(future.globals.maxSize = ...future.globals.maxSize)

0 commit comments

Comments
 (0)