From f2e89bc2b1fa4797c388a6a25c0a0bf8c880e6c1 Mon Sep 17 00:00:00 2001 From: wlandau Date: Tue, 4 Feb 2025 12:51:34 -0500 Subject: [PATCH] docs and messages --- R/class_workspace.R | 15 ++++++++++++++- R/tar_option_set.R | 5 ++++- R/tar_workspace_download.R | 2 +- man/tar_option_set.Rd | 5 ++++- man/tar_workspace_download.Rd | 2 +- targets.Rproj | 1 + 6 files changed, 25 insertions(+), 5 deletions(-) diff --git a/R/class_workspace.R b/R/class_workspace.R index 9516f9465..39f1360af 100644 --- a/R/class_workspace.R +++ b/R/class_workspace.R @@ -25,7 +25,20 @@ workspace_save <- function(workspace, path_store) { workspace_read <- function(name, path_store) { path <- path_workspace(path_store = path_store, name = name) tar_assert_store(store = path_store) - tar_assert_path(path, paste0("no workspace found for target ", name, ".")) + tar_assert_path( + path, + paste0( + "no workspace found for target ", + name, + ". If your pipeline uses cloud storage, you may need to run ", + "tar_workspace_download(", + name, + ") first to download the workspace locally, ", + "then try tar_workspace(", + name, + ") again." + ) + ) readRDS(path) } diff --git a/R/tar_option_set.R b/R/tar_option_set.R index e41e358eb..d6ee67ecb 100644 --- a/R/tar_option_set.R +++ b/R/tar_option_set.R @@ -24,7 +24,10 @@ #' `repository` but excluding content-addressable storage #' (`"aws"`, `"gcp"`, `"local"`). Cloud repository #' for the metadata text files in `_targets/meta/`, including target -#' metadata and progress data. Defaults to `tar_option_get("repository")` +#' metadata and progress data. +#' Also enables cloud backup of workspace files in `_targets/workspaces/` +#' which can be downloaded with [tar_workspace_download()]. +#' `repository_meta` defaults to `tar_option_get("repository")` #' except in the case of content-addressable storage (CAS). #' When `tar_option_get("repository")` is a CAS repository, #' the default value of `repository_meta` is `"local"`. diff --git a/R/tar_workspace_download.R b/R/tar_workspace_download.R index d703c45b7..0b63ae5be 100644 --- a/R/tar_workspace_download.R +++ b/R/tar_workspace_download.R @@ -39,7 +39,7 @@ #' ) #' f <- function() stop("this is an error and thus triggers a workspace") #' list( -#' tar_target(x, f()), +#' tar_target(x, f()) #' ) #' }, ask = FALSE) #' # The following code throws an error for demonstration purposes. diff --git a/man/tar_option_set.Rd b/man/tar_option_set.Rd index 83cbdeac0..8a1d8482c 100644 --- a/man/tar_option_set.Rd +++ b/man/tar_option_set.Rd @@ -146,7 +146,10 @@ the target runs.} \code{repository} but excluding content-addressable storage (\code{"aws"}, \code{"gcp"}, \code{"local"}). Cloud repository for the metadata text files in \verb{_targets/meta/}, including target -metadata and progress data. Defaults to \code{tar_option_get("repository")} +metadata and progress data. +Also enables cloud backup of workspace files in \verb{_targets/workspaces/} +which can be downloaded with \code{\link[=tar_workspace_download]{tar_workspace_download()}}. +\code{repository_meta} defaults to \code{tar_option_get("repository")} except in the case of content-addressable storage (CAS). When \code{tar_option_get("repository")} is a CAS repository, the default value of \code{repository_meta} is \code{"local"}.} diff --git a/man/tar_workspace_download.Rd b/man/tar_workspace_download.Rd index 676af81b9..f444b17e6 100644 --- a/man/tar_workspace_download.Rd +++ b/man/tar_workspace_download.Rd @@ -67,7 +67,7 @@ tar_script({ ) f <- function() stop("this is an error and thus triggers a workspace") list( - tar_target(x, f()), + tar_target(x, f()) ) }, ask = FALSE) # The following code throws an error for demonstration purposes. diff --git a/targets.Rproj b/targets.Rproj index eaa6b8186..d6030f8d7 100644 --- a/targets.Rproj +++ b/targets.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: 45c326ed-3afb-44d4-9b50-07ada6a2e80e RestoreWorkspace: Default SaveWorkspace: Default