Skip to content

Commit 81a1580

Browse files
Remove flexFitR workaround; now fixed in flexFitR
1 parent 14326a4 commit 81a1580

File tree

3 files changed

+1
-50
lines changed

3 files changed

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

R/dofuture_OP.R

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,6 @@ doFuture2 <- function(obj, expr, envir, data) { #nolint
366366
mprint(expr)
367367
}
368368

369-
## Patch expression for flexFitR?
370-
expr <- flexFitR_patch(expr)
371-
372369
## WORKAROUND: foreach::times() passes an empty string in 'argnames'
373370
argnames <- it$argnames
374371
argnames <- argnames[nzchar(argnames)]
@@ -429,13 +426,6 @@ doFuture2 <- function(obj, expr, envir, data) { #nolint
429426
assign("...future.x_ii", 42, envir = globals_envir, inherits = FALSE)
430427
add <- c(add, "...future.x_ii")
431428

432-
if (isTRUE(attr(expr, "patched"))) {
433-
if (debug) mdebug(" - flexFitR patch: rename global 'fn' to 'fn2'")
434-
value <- globalsByName("fn", envir = envir)$fn
435-
assign("fn2", value, envir = globals_envir, inherits = FALSE)
436-
add <- c(add, "fn2")
437-
}
438-
439429
ignore <- attr(globals, "ignore", exact = TRUE)
440430
ignore <- c(ignore, argnames)
441431

R/zzz.R

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ patch_expressions <- function() {
1919
if ("WARDEN" %in% loadedNamespaces()) {
2020
patches <- c(patches, "WARDEN")
2121
}
22-
## Package 'flexFitR'
23-
if ("flexFitR" %in% loadedNamespaces()) {
24-
patches <- c(patches, "flexFitR")
25-
}
2622
}
2723
options(doFuture.patches = patches)
2824
}
@@ -41,41 +37,6 @@ patch_expressions <- function() {
4137
}
4238

4339

44-
flexFitR_tweak_modeler_expr <- function(expr) {
45-
if (!is.call(expr)) return(expr)
46-
expr <- unclass(expr)
47-
op <- expr[[1]]
48-
if (!is.symbol(op)) return(expr)
49-
if (length(expr) != 3L) return(expr)
50-
e <- expr[[3]]
51-
if (length(e) != 10L) return(expr)
52-
op <- e[[1]]
53-
if (!is.symbol(op)) return(expr)
54-
if (as.character(op) != ".fitter_curve") return(expr)
55-
op <- e[[4]]
56-
if (!is.symbol(op)) return(expr)
57-
if (as.character(op) != "fn") return(expr)
58-
e[[4]] <- as.symbol("fn2")
59-
expr[[3]] <- e
60-
attr(expr, "patched") <- TRUE
61-
expr
62-
}
63-
64-
flexFitR_patch <- local({
65-
patch <- NULL
66-
function(expr) {
67-
if (is.null(patch)) {
68-
patch_expressions()
69-
patches <- getOption("doFuture.patches")
70-
patch <<- ("flexFitR" %in% patches)
71-
}
72-
if (!patch) return(expr)
73-
expr <- flexFitR_tweak_modeler_expr(expr)
74-
expr
75-
}
76-
})
77-
78-
7940
## covr: skip=all
8041
.onLoad <- function(libname, pkgname) {
8142
value <- getOption("doFuture.workarounds")

0 commit comments

Comments
 (0)