diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 3eedf6a..45420ca 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -31,7 +31,7 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 - - uses: quarto-dev/quarto-actions/setup@v2 + - uses: quarto-dev/quarto-actions/setup@v2.1.6 - name: Install Mac system dependencies if: runner.os == 'macOS' diff --git a/NEWS.md b/NEWS.md index 46d9942..b1065ad 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ * Detect child quarto documents (#199, @mutlusun). * Improve reporting of static branch names from `tar_map()` and `tar_map_rep()` (#201, @kkmann). * Ensure compatibility with `targets` after https://github.com/ropensci/targets/issues/1368. +* Improve detection of Quarto files in `tar_quarto_inspect()` (#200, @multusun). # tarchetypes 0.10.0 diff --git a/R/tar_quarto_files.R b/R/tar_quarto_files.R index ad6cef8..ca9891b 100644 --- a/R/tar_quarto_files.R +++ b/R/tar_quarto_files.R @@ -11,7 +11,8 @@ #' * `output`: output files that will be generated during #' `quarto::quarto_render()`. #' * `input`: pre-existing files required to render the project or document, -#' such as `_quarto.yml`. +#' such as `_quarto.yml` and quarto extensions. +#' @inheritParams quarto::quarto_render #' @param path Character of length 1, either the file path #' to a Quarto source document or the directory path #' to a Quarto project. Defaults to the Quarto project in the @@ -33,7 +34,7 @@ #' writeLines(lines, path) #' # If Quarto is installed, run: #' # tar_quarto_files(path) -tar_quarto_files <- function(path = ".", profile = NULL) { +tar_quarto_files <- function(path = ".", profile = NULL, quiet = TRUE) { assert_quarto() targets::tar_assert_scalar(path) targets::tar_assert_chr(path) @@ -47,19 +48,22 @@ tar_quarto_files <- function(path = ".", profile = NULL) { } out <- if_any( fs::is_dir(path), - tar_quarto_files_project(path), - tar_quarto_files_document(path) + tar_quarto_files_project(path, quiet), + tar_quarto_files_document(path, quiet) ) for (field in c("sources", "output", "input")) { - out[[field]] <- sort(fs::path_rel(unique(as.character(out[[field]])))) - out[[field]] <- as.character(out[[field]]) + out[[field]] <- as.character(fs::path_rel(out[[field]])) + out[[field]] <- unique(sort(out[[field]])) } out } -tar_quarto_files_document <- function(path) { - info <- quarto::quarto_inspect(input = path) - out <- list(sources = path) +tar_quarto_files_document <- function(path, quiet) { + info <- quarto::quarto_inspect(input = path, quiet = quiet) + out <- list() + + # Collect data about source files. + out$sources <- tar_quarto_files_get_source_files(info$fileInformation) # Collect data about output files. for (format in info$formats) { @@ -69,25 +73,20 @@ tar_quarto_files_document <- function(path) { ) } - # Collect data about input files. - for (myfile in names(info$fileInformation)) { - out$input <- c( - out$input, - # `myfile` are relative paths starting from `path`. - myfile, - # `includeMap` contains relative paths starting from `myfile`. - file.path( - dirname(path), - info$fileInformation[[myfile]]$includeMap$target - ) - ) + # Collect data about input files. As this is not a project, there doesn't + # exist the `info$files` key. However, we can include resources if present. + if (length(info$resources) > 0) { + out$input <- info$resources + out$input <- out$input[file.exists(out$input)] + } else { + out$input <- character(0L) } out } -tar_quarto_files_project <- function(path) { - info <- quarto::quarto_inspect(input = path) +tar_quarto_files_project <- function(path, quiet) { + info <- quarto::quarto_inspect(input = path, quiet) targets::tar_assert_nonempty( info$config$project$`output-dir`, paste( @@ -97,29 +96,59 @@ tar_quarto_files_project <- function(path) { ) ) - # Detect source files. - sources <- info$files$input[file.exists(info$files$input)] + out <- list(output = file.path(path, info$config$project$`output-dir`)) + + # Collect data about source files. + out$sources <- tar_quarto_files_get_source_files(info$fileInformation) - # Detect input files. - input <- info$files - input <- unlist(input) - input <- input[file.exists(input)] - for (myfile in names(info$fileInformation)) { - input <- c( - input, - # `myfile` is an absolute path. + # Detect input files like the config file (`_quarto.yml`) and resources like + # quarto extensions. Make sure in the end that these files exist. + out$input <- unlist( + c( + info$files$config, + info$files$resources + ) + ) + out$input <- out$input[file.exists(out$input)] + + out +} + +#' @title Get Source Files From Quarto Inspect +#' @description Collects all files from the +#' `fileInformation` field that are used in the current report. +#' @details `fileInformation` contains a list of files. Each file entry contains +#' two data frames. The first, `includeMap`, contains a `source` column (files +#' that include other files, e.g. the main report file) and a `target` column +#' (files that get included by the `source` files). The `codeCells` data frame +#' contains all code cells from the files represented in `includeMap`. +#' @return A character vector of Quarto source files. +#' @param file_information The `fileInformation` element of the list +#' returned by `quarto::quarto_inspect()`. +tar_quarto_files_get_source_files <- function(file_information) { + ret <- character(0) + + for (myfile in names(file_information)) { + # Collect relevant source files. The files in `includeMap$target` are always + # relative to the main entry point of the report. Thus, we need to add the + # corresponding paths to the entries. + # + # We don't need to include the `source` column as all files are also present + # in `target` or are `myfile`. + ret <- c( + ret, myfile, - # `includeMap` files are relative starting from `myfile`. file.path( dirname(myfile), - info$fileInformation[[myfile]]$includeMap$target + file_information[[myfile]]$includeMap$target ) ) } - list( - sources = sources, - output = file.path(path, info$config$project$`output-dir`), - input = input - ) + # Check that these files actually exist. + ret <- ret[file.exists(ret)] + + # We don't need to call `unique` here on `ret` as this happens on the main + # function. + ret } diff --git a/R/tar_quarto_raw.R b/R/tar_quarto_raw.R index 618fff9..588e661 100644 --- a/R/tar_quarto_raw.R +++ b/R/tar_quarto_raw.R @@ -58,7 +58,7 @@ tar_quarto_raw <- function( targets::tar_assert_scalar(profile %|||% ".") targets::tar_assert_chr(profile %|||% ".") targets::tar_assert_nzchar(profile %|||% ".") - info <- tar_quarto_files(path = path, profile = profile) + info <- tar_quarto_files(path = path, profile = profile, quiet = quiet) sources <- info$sources output <- info$output if (!is.null(output_file)) { diff --git a/R/tar_quarto_rep_raw.R b/R/tar_quarto_rep_raw.R index e6624c4..dca78da 100644 --- a/R/tar_quarto_rep_raw.R +++ b/R/tar_quarto_rep_raw.R @@ -59,7 +59,10 @@ tar_quarto_rep_raw <- function( rep_workers <- as.integer(rep_workers) name_params <- paste0(name, "_params") sym_params <- as.symbol(name_params) - default_output_file <- utils::head(tar_quarto_files(path)$output, n = 1L) + default_output_file <- utils::head( + tar_quarto_files(path, quiet = quiet)$output, + n = 1L + ) default_output_file <- default_output_file %||% fs::path_ext_set(path, "html") target_params <- targets::tar_target_raw( diff --git a/man/tar_age.Rd b/man/tar_age.Rd index 1759b18..75e98c5 100644 --- a/man/tar_age.Rd +++ b/man/tar_age.Rd @@ -90,7 +90,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -109,19 +111,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -129,8 +138,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_change.Rd b/man/tar_change.Rd index 529512e..a6ac6b9 100644 --- a/man/tar_change.Rd +++ b/man/tar_change.Rd @@ -125,7 +125,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -144,19 +146,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -164,8 +173,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_combine.Rd b/man/tar_combine.Rd index fd8b49a..a4d486c 100644 --- a/man/tar_combine.Rd +++ b/man/tar_combine.Rd @@ -150,7 +150,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -169,19 +171,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -189,8 +198,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_download.Rd b/man/tar_download.Rd index 0563ed8..1efaeb5 100644 --- a/man/tar_download.Rd +++ b/man/tar_download.Rd @@ -111,7 +111,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -130,19 +132,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -150,8 +159,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_file_read.Rd b/man/tar_file_read.Rd index 4d2e330..0794a6d 100644 --- a/man/tar_file_read.Rd +++ b/man/tar_file_read.Rd @@ -109,7 +109,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -128,19 +130,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -148,8 +157,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_files.Rd b/man/tar_files.Rd index 2325d1f..d1490b1 100644 --- a/man/tar_files.Rd +++ b/man/tar_files.Rd @@ -129,7 +129,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -148,19 +150,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -168,8 +177,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_files_input.Rd b/man/tar_files_input.Rd index 48bf6fd..ec6e627 100644 --- a/man/tar_files_input.Rd +++ b/man/tar_files_input.Rd @@ -95,7 +95,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -114,19 +116,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -134,8 +143,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{priority}{Numeric of length 1 between 0 and 1. Controls which targets get deployed first when multiple competing targets are ready diff --git a/man/tar_force.Rd b/man/tar_force.Rd index 31ad30f..f932fe9 100644 --- a/man/tar_force.Rd +++ b/man/tar_force.Rd @@ -126,7 +126,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -145,19 +147,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -165,8 +174,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_formats.Rd b/man/tar_formats.Rd index b00118b..bf4cb4e 100644 --- a/man/tar_formats.Rd +++ b/man/tar_formats.Rd @@ -396,7 +396,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -415,19 +417,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -435,8 +444,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_formats_superseded.Rd b/man/tar_formats_superseded.Rd index 6883809..68d9c5b 100644 --- a/man/tar_formats_superseded.Rd +++ b/man/tar_formats_superseded.Rd @@ -350,7 +350,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -369,19 +371,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -389,8 +398,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_group_by.Rd b/man/tar_group_by.Rd index 08d7d02..0518e00 100644 --- a/man/tar_group_by.Rd +++ b/man/tar_group_by.Rd @@ -106,7 +106,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -125,19 +127,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -145,8 +154,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_group_count.Rd b/man/tar_group_count.Rd index 4fd8b90..281f8cb 100644 --- a/man/tar_group_count.Rd +++ b/man/tar_group_count.Rd @@ -106,7 +106,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -125,19 +127,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -145,8 +154,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_group_select.Rd b/man/tar_group_select.Rd index 808009c..440ec31 100644 --- a/man/tar_group_select.Rd +++ b/man/tar_group_select.Rd @@ -107,7 +107,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -126,19 +128,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -146,8 +155,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_group_size.Rd b/man/tar_group_size.Rd index d170282..67fae2a 100644 --- a/man/tar_group_size.Rd +++ b/man/tar_group_size.Rd @@ -107,7 +107,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -126,19 +128,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -146,8 +155,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_knit.Rd b/man/tar_knit.Rd index e8ae7d8..243d8cc 100644 --- a/man/tar_knit.Rd +++ b/man/tar_knit.Rd @@ -87,7 +87,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -106,19 +108,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -126,8 +135,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_map2.Rd b/man/tar_map2.Rd index b9f596d..f5dfbb1 100644 --- a/man/tar_map2.Rd +++ b/man/tar_map2.Rd @@ -203,7 +203,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -222,19 +224,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -242,8 +251,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_map2_count.Rd b/man/tar_map2_count.Rd index 9d0acd7..29e1167 100644 --- a/man/tar_map2_count.Rd +++ b/man/tar_map2_count.Rd @@ -210,7 +210,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -229,19 +231,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -249,8 +258,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_map2_size.Rd b/man/tar_map2_size.Rd index 8bfe52e..cb5ad82 100644 --- a/man/tar_map2_size.Rd +++ b/man/tar_map2_size.Rd @@ -210,7 +210,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -229,19 +231,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -249,8 +258,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_map_rep.Rd b/man/tar_map_rep.Rd index 34001e4..539be1b 100644 --- a/man/tar_map_rep.Rd +++ b/man/tar_map_rep.Rd @@ -176,7 +176,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -195,19 +197,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -215,8 +224,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_quarto.Rd b/man/tar_quarto.Rd index 58297f8..fc086f2 100644 --- a/man/tar_quarto.Rd +++ b/man/tar_quarto.Rd @@ -143,7 +143,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -162,19 +164,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -182,8 +191,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_quarto_files.Rd b/man/tar_quarto_files.Rd index edcc39e..acd15cb 100644 --- a/man/tar_quarto_files.Rd +++ b/man/tar_quarto_files.Rd @@ -4,7 +4,7 @@ \alias{tar_quarto_files} \title{Quarto file detection} \usage{ -tar_quarto_files(path = ".", profile = NULL) +tar_quarto_files(path = ".", profile = NULL, quiet = TRUE) } \arguments{ \item{path}{Character of length 1, either the file path @@ -15,6 +15,8 @@ current working directory.} \item{profile}{Character of length 1, Quarto profile. If \code{NULL}, the default profile will be used. Requires Quarto version 1.2 or higher. See \url{https://quarto.org/docs/projects/profiles.html} for details.} + +\item{quiet}{Suppress warning and other messages.} } \value{ A named list of important file paths in a Quarto project or document: @@ -24,7 +26,7 @@ dependencies in code chunks using \code{tar_load()}/\code{tar_read()}. \item \code{output}: output files that will be generated during \code{quarto::quarto_render()}. \item \code{input}: pre-existing files required to render the project or document, -such as \verb{_quarto.yml}. +such as \verb{_quarto.yml} and quarto extensions. } } \description{ diff --git a/man/tar_quarto_files_get_source_files.Rd b/man/tar_quarto_files_get_source_files.Rd new file mode 100644 index 0000000..c5f6a99 --- /dev/null +++ b/man/tar_quarto_files_get_source_files.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tar_quarto_files.R +\name{tar_quarto_files_get_source_files} +\alias{tar_quarto_files_get_source_files} +\title{Get Source Files From Quarto Inspect} +\usage{ +tar_quarto_files_get_source_files(file_information) +} +\arguments{ +\item{file_information}{The \code{fileInformation} element of the list +returned by \code{quarto::quarto_inspect()}.} +} +\value{ +A character vector of Quarto source files. +} +\description{ +Collects all files from the +\code{fileInformation} field that are used in the current report. +} +\details{ +\code{fileInformation} contains a list of files. Each file entry contains +two data frames. The first, \code{includeMap}, contains a \code{source} column (files +that include other files, e.g. the main report file) and a \code{target} column +(files that get included by the \code{source} files). The \code{codeCells} data frame +contains all code cells from the files represented in \code{includeMap}. +} diff --git a/man/tar_quarto_rep.Rd b/man/tar_quarto_rep.Rd index 20e5ba6..1bbcd22 100644 --- a/man/tar_quarto_rep.Rd +++ b/man/tar_quarto_rep.Rd @@ -184,7 +184,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -203,19 +205,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -223,8 +232,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_render.Rd b/man/tar_render.Rd index d063a9a..e2b16ab 100644 --- a/man/tar_render.Rd +++ b/man/tar_render.Rd @@ -86,7 +86,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -105,19 +107,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -125,8 +134,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_render_rep.Rd b/man/tar_render_rep.Rd index 96412b2..03f9a90 100644 --- a/man/tar_render_rep.Rd +++ b/man/tar_render_rep.Rd @@ -129,7 +129,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -148,19 +150,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -168,8 +177,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_rep.Rd b/man/tar_rep.Rd index fd31717..ad1b12d 100644 --- a/man/tar_rep.Rd +++ b/man/tar_rep.Rd @@ -153,7 +153,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -172,19 +174,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -192,8 +201,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_rep2.Rd b/man/tar_rep2.Rd index ee9d1c4..c16c714 100644 --- a/man/tar_rep2.Rd +++ b/man/tar_rep2.Rd @@ -158,7 +158,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -177,19 +179,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -197,8 +206,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_rep_map.Rd b/man/tar_rep_map.Rd index 1871b6d..58fd089 100644 --- a/man/tar_rep_map.Rd +++ b/man/tar_rep_map.Rd @@ -131,7 +131,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -150,19 +152,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -170,8 +179,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_rep_map_raw.Rd b/man/tar_rep_map_raw.Rd index c1031b0..97c8ab3 100644 --- a/man/tar_rep_map_raw.Rd +++ b/man/tar_rep_map_raw.Rd @@ -132,7 +132,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -151,19 +153,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -171,8 +180,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/man/tar_skip.Rd b/man/tar_skip.Rd index a6e3a90..3736bbf 100644 --- a/man/tar_skip.Rd +++ b/man/tar_skip.Rd @@ -126,7 +126,9 @@ stops and throws an error. Options: \item \code{"continue"}: the whole pipeline keeps going. \item \code{"null"}: The errored target continues and returns \code{NULL}. The data hash is deliberately wrong so the target is not -up to date for the next run of the pipeline. +up to date for the next run of the pipeline. In addition, +as of version 1.8.0.9011, a value of \code{NULL} is given +to upstream dependencies with \code{error = "null"} if loading fails. \item \code{"abridge"}: any currently running targets keep running, but no new targets launch after that. \item \code{"trim"}: all currently running targets stay running. A queued @@ -145,19 +147,26 @@ to begin running. to learn how to debug targets using saved workspaces.) }} -\item{memory}{Character of length 1, memory strategy. -If \code{"persistent"}, the target stays in memory +\item{memory}{Character of length 1, memory strategy. Possible values: +\itemize{ +\item \code{"auto"}: new in \code{targets} version 1.8.0.9011, \code{memory = "auto"} +is equivalent to \code{memory = "transient"} for dynamic branching +(a non-null \code{pattern} argument) and \code{memory = "persistent"} +for targets that do not use dynamic branching. +\item \code{"persistent"}: the target stays in memory until the end of the pipeline (unless \code{storage} is \code{"worker"}, in which case \code{targets} unloads the value from memory right after storing it in order to avoid sending copious data over a network). -If \code{"transient"}, the target gets unloaded +\item \code{"transient"}: the target gets unloaded after every new target completes. Either way, the target gets automatically loaded into memory whenever another target needs the value. +} + For cloud-based dynamic files (e.g. \code{format = "file"} with \code{repository = "aws"}), -this memory strategy applies to the +the \code{memory} option applies to the temporary local copy of the file: \code{"persistent"} means it remains until the end of the pipeline and is then deleted, @@ -165,8 +174,17 @@ and \code{"transient"} means it gets deleted as soon as possible. The former conserves bandwidth, and the latter conserves local storage.} -\item{garbage_collection}{Logical, whether to run \code{base::gc()} -just before the target runs.} +\item{garbage_collection}{Logical: \code{TRUE} to run \code{base::gc()} +just before the target runs, +\code{FALSE} to omit garbage collection. +In the case of high-performance computing, +\code{gc()} runs both locally and on the parallel worker. +All this garbage collection is skipped if the actual target +is skipped in the pipeline. +Non-logical values of \code{garbage_collection} are converted to \code{TRUE} or +\code{FALSE} using \code{isTRUE()}. In other words, non-logical values are +converted \code{FALSE}. For example, \code{garbage_collection = 2} +is equivalent to \code{garbage_collection = FALSE}.} \item{deployment}{Character of length 1. If \code{deployment} is \code{"main"}, then the target will run on the central controlling R process. diff --git a/tests/testthat/helper-utils.R b/tests/testthat/helper-utils.R index 7d86d66..d9444c8 100644 --- a/tests/testthat/helper-utils.R +++ b/tests/testthat/helper-utils.R @@ -6,9 +6,12 @@ expect_equiv <- function(object, expected, ...) { skip_quarto <- function() { skip_pandoc() - skip_if_not_installed("quarto") - if (is.null(quarto::quarto_path())) { - skip("Quarto not found.") + skip_if_not_installed("quarto", minimum_version = "1.4.4") + quarto_version <- as.character(quarto::quarto_version()) + no_quarto <- is.null(quarto::quarto_path()) || + utils::compareVersion(quarto_version, "1.6.33") < 0L + if (no_quarto) { + skip("Quarto >= 1.6.33 not found.") } } diff --git a/tests/testthat/test-tar_quarto.R b/tests/testthat/test-tar_quarto.R index f4a8654..3b90dee 100644 --- a/tests/testthat/test-tar_quarto.R +++ b/tests/testthat/test-tar_quarto.R @@ -482,3 +482,129 @@ targets::tar_test("tar_quarto() creates custom output file", { expect_false(file.exists(file.path("report.html"))) expect_true(file.exists(file.path("test.html"))) }) + +targets::tar_test("tar_quarto() reruns if target changes in included file", { + skip_quarto() + lines <- c( + "---", + "title: main", + "output_format: html", + "---", + "", + "{{< include \"file1.qmd\" >}}" + ) + writeLines(lines, "main.qmd") + lines <- c( + "# First File", + "", + "Contains a code cell with a target.", + "", + "```{r}", + "targets::tar_read(data)", + "```" + ) + writeLines(lines, "file1.qmd") + targets::tar_script({ + library(tarchetypes) + list( + tar_target(data, data.frame(x = seq_len(26L), y = letters)), + tar_quarto(report, path = "main.qmd") + ) + }) + # First run. + suppressMessages(targets::tar_make(callr_function = NULL)) + progress <- targets::tar_progress() + progress <- progress[progress$progress != "skipped", ] + expect_equal(sort(progress$name), sort(c("data", "report"))) + out <- targets::tar_read(report) + out <- setdiff(out, "main_files") + if (identical(tolower(Sys.info()[["sysname"]]), "windows")) { + expect_equal( + # On the windows CI, there seems to be issues and `fs::path_rel`. Because + # of that, `file1.qmd` is returned twice and we use `unique` here. On + # other platforms this issue does not exist. + # + # See https://github.com/ropensci/tarchetypes/pull/200 for a discussion. + sort(unique(basename(out))), + sort(c("main.html", "main.qmd", "file1.qmd")) + ) + } else { + expect_equal( + sort(basename(out)), + sort(c("main.html", "main.qmd", "file1.qmd")) + ) + } + # Should not rerun the report. + suppressMessages(targets::tar_make(callr_function = NULL)) + progress <- targets::tar_progress() + progress <- progress[progress$progress != "skipped", ] + expect_equal(nrow(progress), 0L) + # Should rerun the report. + targets::tar_script({ + library(tarchetypes) + list( + tar_target(data, data.frame(x = rev(seq_len(26L)), y = letters)), + tar_quarto(report, path = "main.qmd") + ) + }) + suppressMessages(targets::tar_make(callr_function = NULL)) + expect_equal(sort(targets::tar_progress()$name), sort(c("data", "report"))) +}) + +targets::tar_test("tar_quarto() reruns if an included file changes", { + skip_quarto() + lines <- c( + "---", + "title: main", + "output_format: html", + "---", + "", + "{{< include \"file1.qmd\" >}}" + ) + writeLines(lines, "main.qmd") + lines <- c( + "# First File", + "", + "Includes another file.", + "", + "{{< include \"file2.qmd\" >}}" + ) + writeLines(lines, "file1.qmd") + lines <- c( + "# Second File", + "", + "Does not include another file." + ) + writeLines(lines, "file2.qmd") + targets::tar_script({ + library(tarchetypes) + list( + tar_quarto(report, path = "main.qmd") + ) + }) + # First run. + suppressMessages(targets::tar_make(callr_function = NULL)) + progress <- targets::tar_progress() + progress <- progress[progress$progress != "skipped", ] + expect_equal(sort(progress$name), sort(c("report"))) + out <- targets::tar_read(report) + out <- setdiff(out, "main_files") + expect_equal( + sort(basename(out)), + sort(c("main.html", "main.qmd", "file1.qmd", "file2.qmd")) + ) + # Should not rerun the report. + suppressMessages(targets::tar_make(callr_function = NULL)) + progress <- targets::tar_progress() + progress <- progress[progress$progress != "skipped", ] + expect_equal(nrow(progress), 0L) + # Should rerun the report. + lines <- c( + "# Second File", + "", + "A change to the second file." + ) + writeLines(lines, "file2.qmd") + suppressMessages(targets::tar_make(callr_function = NULL)) + expect_equal(sort(targets::tar_progress()$name), sort(c("report"))) +}) diff --git a/tests/testthat/test-tar_quarto_files.R b/tests/testthat/test-tar_quarto_files.R index 271c8e6..5d80049 100644 --- a/tests/testthat/test-tar_quarto_files.R +++ b/tests/testthat/test-tar_quarto_files.R @@ -16,7 +16,7 @@ targets::tar_test("tar_quarto_files() single Rmd/qmd", { out <- tar_quarto_files(path) expect_equal(out$sources, file.path("x", paste0("report", ext))) expect_equal(out$output, file.path("x", "report.html")) - expect_equal(out$input, file.path("x", paste0("report", ext))) + expect_equal(out$input, character(0)) } }) @@ -62,55 +62,49 @@ targets::tar_test("tar_quarto_files() project", { sort(c("index.qmd", "r2.qmd")) ) expect_equal(basename(info$output), "_book") - expect_equal( - sort(basename(info$input)), - sort(c("_quarto.yml", "index.qmd", "r2.qmd")) - ) + expect_equal(basename(info$input), "_quarto.yml") } else { expect_equal( sort(info$sources), sort(file.path("x", c("index.qmd", "r2.qmd"))) ) expect_equal(info$output, file.path("x", "_book")) - expect_equal( - sort(info$input), - sort(file.path("x", c("_quarto.yml", "index.qmd", "r2.qmd"))) - ) + expect_equal(info$input, file.path("x", "_quarto.yml")) } }) -targets::tar_test("tar_quarto_files() detects non-code dependencies", { +targets::tar_test("tar_quarto_files() detects nested dependencies", { skip_quarto() fs::dir_create("report") fs::dir_create(file.path("report", "subdir")) + fs::dir_create(file.path("report", "subdir", "b")) lines <- c( "---", "title: main", "output_format: html", "---", "", - "{{< include \"text1.qmd\" >}}", - "", - "{{< include \"subdir/text2.qmd\" >}}" + "{{< include \"text1.qmd\" >}}" ) writeLines(lines, file.path("report", "main.qmd")) lines <- c( "# First File", "", - "Some text here." + "Some text here.", + "", + "{{< include \"subdir/text2.qmd\" >}}" ) writeLines(lines, file.path("report", "text1.qmd")) lines <- c( "# Second File", "", - "Some text here." + "Some text here.", + "" ) writeLines(lines, file.path("report", "subdir", "text2.qmd")) - out <- tar_quarto_files("report/main.qmd") - expect_equal(out$sources, "report/main.qmd") - expect_equal(out$output, "report/main.html") + out <- tar_quarto_files(file.path("report", "main.qmd")) expect_equal( - sort(out$input), + sort(out$sources), sort( c( file.path("report", c("main.qmd", "text1.qmd")), @@ -118,8 +112,10 @@ targets::tar_test("tar_quarto_files() detects non-code dependencies", { ) ) ) + expect_equal(out$output, file.path("report", "main.html")) + expect_equal(out$input, character()) # Check whether we get the same result with a reference to the directory - # instead of the file. + # instead of the file (render a project). lines <- c( "project:", " output-dir: myoutdir", @@ -129,26 +125,49 @@ targets::tar_test("tar_quarto_files() detects non-code dependencies", { writeLines(lines, file.path("report", "_quarto.yml")) out <- tar_quarto_files("report/") if (identical(tolower(Sys.info()[["sysname"]]), "windows")) { - expect_equal(basename(out$sources), "main.qmd") - expect_equal(basename(out$output), "myoutdir") expect_equal( - sort(basename(out$input)), - sort(c("_quarto.yml", "main.qmd", "text1.qmd", "text2.qmd")) + basename(out$sources), + sort( + c("main.qmd", "text1.qmd", "text2.qmd") + ) ) + expect_equal(basename(out$output), "myoutdir") + expect_equal(basename(out$input), "_quarto.yml") } else { - expect_equal(out$sources, file.path("report", "main.qmd")) - expect_equal(out$output, file.path("report", "myoutdir")) expect_equal( - sort(out$input), + out$sources, sort( c( - file.path( - "report", - c("_quarto.yml", "main.qmd", "text1.qmd") - ), + file.path("report", c("main.qmd", "text1.qmd")), file.path("report", "subdir", "text2.qmd") ) ) ) + expect_equal(out$output, file.path("report", "myoutdir")) + expect_equal( + out$input, + file.path("report", "_quarto.yml") + ) } }) + +targets::tar_test("tar_quarto_files() detects custom output file", { + skip_quarto() + lines <- c( + "---", + "title: source file", + "format:", + " html:", + " output-file: custom.html", + "---", + "Assume these lines are in report.qmd.", + "```{r}", + "1 + 1", + "```" + ) + writeLines(lines, "report.qmd") + out <- tar_quarto_files("report.qmd") + expect_equal(out$sources, "report.qmd") + expect_equal(out$output, "custom.html") + expect_equal(out$input, character(0)) +})