Skip to content

Commit

Permalink
avoid memo_expr()
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed May 15, 2024
1 parent 4770af1 commit 7d4492f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Remove environment locking, c.f. https://github.com/r-lib/rlang/issues/1705.
* Export S3 methods.
* Avoid `memo_expr()` because it causes errors on R-devel.

# Version 7.13.9

Expand Down
14 changes: 2 additions & 12 deletions R/create_drake_graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,8 @@ create_drake_graph <- function(
logger
) {
args <- list(plan = plan, jobs = jobs, logger = logger, cache = cache)
edges <- memo_expr(
cdg_create_edges(args, spec),
cache,
plan,
spec
)
memo_expr(
cdg_finalize_graph(edges, targets, args),
cache,
edges,
targets
)
edges <- cdg_create_edges(args, spec)
cdg_finalize_graph(edges, targets, args)
}

cdg_create_edges <- function(args, spec) {
Expand Down
16 changes: 2 additions & 14 deletions R/create_drake_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,9 @@ create_drake_spec <- function(
)
imports <- cds_prepare_imports(args)
imports_kernel <- cds_imports_kernel(args, imports)
import_spec <- memo_expr(
cds_analyze_imports(args, imports),
args$cache,
imports_kernel
)
import_spec <- cds_analyze_imports(args, imports)
knitr_hash <- cds_get_knitr_hash(args)
command_spec <- memo_expr(
cds_analyze_commands(args),
args$cache,
args$plan,
args$trigger,
import_spec,
imports_kernel,
knitr_hash
)
command_spec <- cds_analyze_commands(args)
cds_set_knitr_files(args = args, spec = command_spec)
out <- c(import_spec, command_spec)
list2env(out, parent = emptyenv(), hash = TRUE)
Expand Down

0 comments on commit 7d4492f

Please sign in to comment.