Skip to content

Commit

Permalink
Eliminate accidental creations of .drake_history/
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Jul 21, 2019
1 parent f937409 commit 55b50e4
Show file tree
Hide file tree
Showing 73 changed files with 107 additions and 833 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Description: A general-purpose computational engine for data analysis,
to practical examples and more, is available at the reference website
<https://ropensci.github.io/drake/> and the online manual
<https://ropenscilabs.github.io/drake-manual/>.
Version: 7.5.1
Version: 7.5.2
License: GPL-3
URL: https://github.com/ropensci/drake
BugReports: https://github.com/ropensci/drake/issues
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Version 7.5.2

## Bug fixes

- Eliminate accidental creations of `.drake_history` in `plan_to_code()`, `plan_to_notebook()`, and the examples in the help files.


# Version 7.5.1

## Bug fixes
Expand Down
1 change: 1 addition & 0 deletions R/api-codetoplan.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ plan_to_text <- function(plan) {
plan[, c("target", "command")],
envir = new.env(parent = emptyenv()),
cache = storr::storr_environment(),
history = FALSE,
verbose = FALSE
)$graph
order <- igraph::topo_sort(graph)$name
Expand Down
2 changes: 2 additions & 0 deletions R/api-exposeimports.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#' of the imports.
#' @examples
#' \dontrun{
#' isolate_example("contain side effects", {
#' # Suppose you have a workflow that uses the `digest()` function,
#' # which computes the hash of an object.
#'
Expand Down Expand Up @@ -84,6 +85,7 @@
#' }
#' config <- drake_config(plan, cache = cache, history = FALSE)
#' tracked(config)
#' })
#' }
expose_imports <- function(
package,
Expand Down
2 changes: 2 additions & 0 deletions R/api-progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ running <- function(
#' @param upstream_only Deprecated.
#' @examples
#' \dontrun{
#' isolate_example("contain side effects", {
#' if (suppressWarnings(require("knitr"))) {
#' # Build a plan doomed to fail:
#' bad_plan <- drake_plan(x = function_doesnt_exist())
Expand All @@ -156,6 +157,7 @@ running <- function(
#' e$error
#' names(e$error)
#' }
#' })
#' }
failed <- function(
path = NULL,
Expand Down
4 changes: 4 additions & 0 deletions R/api-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ bind_load_target <- function(target, cache, namespace, envir, verbose) {
#' @inheritParams cached
#'
#' @examples
#' \dontrun{
#' isolate_example("contain side effects", {
#' cache <- storr::storr_environment() # Just for the examples.
#' my_plan <- drake_plan(
#' target1 = sqrt(1234),
Expand Down Expand Up @@ -447,6 +449,8 @@ bind_load_target <- function(target, cache, namespace, envir, verbose) {
#' make(my_plan, cache = cache, seed = 1234)
#' read_drake_seed(cache = cache)
#' readd(target2, cache = cache)
#' })
#' }
read_drake_seed <- function(
path = NULL,
search = NULL,
Expand Down
2 changes: 2 additions & 0 deletions R/api-slice.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#' drake_slice(x, slices = 3, margin = 2, index = 1)
#' # In drake, you can split a large dataset over multiple targets.
#' \dontrun{
#' isolate_example("contain side effects", {
#' plan <- drake_plan(
#' large_data = iris,
#' data_split = target(
Expand All @@ -47,6 +48,7 @@
#' make(plan, cache = cache, session_info = FALSE, verbose = FALSE)
#' readd(data_split_1L, cache = cache)
#' readd(data_split_2L, cache = cache)
#' })
#' }
drake_slice <- function(data, slices, index, margin = 1L, drop = FALSE) {
check_drake_slice_args(margin, slices, index)
Expand Down
2 changes: 2 additions & 0 deletions R/api-usedrake.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#' @export
#' @param open Logical, whether to open `make.R` for editing.
#' @examples
#' \dontrun{
#' # use_drake(open = FALSE) # nolint
#' }
use_drake <- function(open = interactive()) {
# Covered in tests/testthat/test-always-skipped.R.
# Reason: https://github.com/r-lib/usethis/issues/347
Expand Down
1 change: 0 additions & 1 deletion R/drake_plan_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#' )
#' your_plan <- bind_plans(download_plan, analysis_plan)
#' your_plan
#' # make(your_plan) # nolint
bind_plans <- function(...) {
sanitize_plan(drake_bind_rows(...))
}
6 changes: 6 additions & 0 deletions R/drake_plan_keywords.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ file_out <- file_in
#' source files supplied to a command in your workflow plan data frame.
#' @examples
#' \dontrun{
#' isolate_example("contain side effects", {
#' # `knitr_in()` is like `file_in()`
#' # except that it analyzes active code chunks in your `knitr`
#' # source file and detects non-file dependencies.
Expand All @@ -204,6 +205,7 @@ file_out <- file_in
#' # to analyze the active code chunks. There, it spotted
#' # where `small`, `large`, and `coef_regression2_small`
#' # were read from the cache using calls to `loadd()` and `readd()`.
#' })
#' }
knitr_in <- file_in

Expand Down Expand Up @@ -317,6 +319,8 @@ no_deps <- function(x = NULL) {
#' @seealso [from_plan()]
#' @return The environment where `drake` builds targets.
#' @examples
#' \dontrun{
#' isolate_example("contain side effects", {
#' plan <- drake_plan(
#' large_data_1 = sample.int(1e4),
#' large_data_2 = sample.int(1e4),
Expand All @@ -330,6 +334,8 @@ no_deps <- function(x = NULL) {
#' }
#' )
#' make(plan, cache = storr::storr_environment(), session_info = FALSE)
#' })
#' }
drake_envir <- function() {
envir <- environment()
for (i in seq_len(getOption("expressions"))) {
Expand Down
2 changes: 0 additions & 2 deletions R/exec-imports.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ process_imports <- function(config) {
#' @keywords internal
#' @param import Character, name of an import to process
#' @param config [drake_config()] object
#' @examples
#' # Not a user-side function.
process_import <- function(import, config) {
meta <- drake_meta_(import, config)
if (meta$isfile) {
Expand Down
2 changes: 0 additions & 2 deletions R/exec-memory.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ assign_to_envir <- function(target, value, config) {
#' @param downstream Optional, character vector of any targets
#' assumed to be downstream.
#' @param jobs Number of jobs for local parallel computing
#' @examples
#' # Users should use make().
manage_memory <- function(target, config, downstream = NULL, jobs = 1) {
stopifnot(length(target) == 1L)
if (identical(config$garbage_collection, TRUE)) {
Expand Down
Loading

0 comments on commit 55b50e4

Please sign in to comment.