Skip to content

Commit

Permalink
Update usage of lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Aug 8, 2020
1 parent d289aa1 commit 4bf6b14
Show file tree
Hide file tree
Showing 244 changed files with 404 additions and 471 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: drake
Title: A Pipeline Toolkit for Reproducible Computation at Scale
Version: 7.12.4
Version: 7.12.4.9000
Authors@R: c(
person(
given = c("William", "Michael"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
* Handle cases where `NROW()` throws an error (#1300, `julian-tagell` on Stack Overflow).
* Prohibit dynamic branching over non-branching dynamic files (#1302, @djbirke).

## Enhancements

* Transition to updated `lifecycle` that does not require badges to be in `man/figures`.

# Version 7.12.4

* Fix a CRAN warning about docs.
Expand Down
2 changes: 1 addition & 1 deletion R/backend_clustermq.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ cmq_deps_list <- function(target, config) {
}

#' @title Build a target using the clustermq backend
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description For internal use only
#' @export
#' @keywords internal
Expand Down
2 changes: 1 addition & 1 deletion R/backend_future.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ future_globals <- function(
}

#' @title Task passed to individual futures in the `"future"` backend
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description For internal use only. Only exported to make available
#' to futures.
#' @keywords internal
Expand Down
2 changes: 1 addition & 1 deletion R/build_times.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @title See the time it took to build each target.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Applies to targets in your plan, not imports or files.
#' @details Times for dynamic targets
#' (<https://books.ropensci.org/drake/dynamic.html>)
Expand Down
36 changes: 18 additions & 18 deletions R/cache.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @title Read and return a drake target/import from the cache.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description [readd()] returns an object from the cache,
#' and [loadd()] loads one or more objects from the cache
#' into your environment or session. These objects are usually
Expand Down Expand Up @@ -125,7 +125,7 @@ readd <- function(
}

#' @title Load one or more targets or imports from the drake cache.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @rdname readd
#' @seealso [cached()], [drake_plan()], [make()]
#' @export
Expand Down Expand Up @@ -444,7 +444,7 @@ parse_lazy_arg <- function(lazy) {
}

#' @title Show how a target/import was produced.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Show the command that produced a target
#' or indicate that the object or file was imported.
#' @export
Expand Down Expand Up @@ -488,7 +488,7 @@ show_source <- function(target, config, character_only = FALSE) {
}

#' @title Read the pseudo-random number generator seed of the project.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description When a project is created with [make()]
#' or [drake_config()], the project's pseudo-random number generator
#' seed is cached. Then, unless the cache is destroyed,
Expand Down Expand Up @@ -561,7 +561,7 @@ read_drake_seed <- function(
}

#' @title List targets in the cache.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Tip: read/load a cached item with [readd()]
#' or [loadd()].
#' @seealso [cached_planned()], [cached_unplanned()],
Expand Down Expand Up @@ -652,7 +652,7 @@ cached <- function(
}

#' @title List targets in both the plan and the cache.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Includes dynamic sub-targets as well.
#' See examples for details.
#' @seealso [cached()], [cached_unplanned]
Expand Down Expand Up @@ -698,7 +698,7 @@ cached_planned <- function(
}

#' @title List targets in the cache but not the plan.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Includes dynamic sub-targets as well.
#' See examples for details.
#' @seealso [cached()], [cached_planned]
Expand Down Expand Up @@ -770,7 +770,7 @@ is_imported_cache <- Vectorize(function(target, cache) {
"target", SIMPLIFY = TRUE)

#' @title Get the cache of a `drake` project.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description [make()] saves the values of your targets so
#' you rarely need to think about output files. By default,
#' the cache is a hidden folder called `.drake/`.
Expand Down Expand Up @@ -862,7 +862,7 @@ drake_cache <- function(
}

#' @title Search up the file system for the nearest drake cache.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Only works if the cache is a file system in a
#' hidden folder named `.drake/` (default).
#' @seealso [drake_plan()], [make()],
Expand Down Expand Up @@ -908,7 +908,7 @@ find_cache <- function(
}

#' @title Make a new `drake` cache.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Uses the [storr_rds()] function
#' from the `storr` package.
#' @export
Expand Down Expand Up @@ -1059,7 +1059,7 @@ drake_cache_version <- function(cache) {
}

#' @title Session info of the last call to [make()].
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description By default, session info is saved
#' during [make()] to ensure reproducibility.
#' Your loaded packages and their versions are recorded, for example.
Expand Down Expand Up @@ -1093,7 +1093,7 @@ drake_get_session_info <- function(
}

#' @title Get the state of the cache.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Get the fingerprints of all the targets in a data frame.
#' This functionality is like
#' `make(..., cache_log_file = TRUE)`,
Expand Down Expand Up @@ -1213,7 +1213,7 @@ single_cache_log <- function(key, cache) {
}

#' @title Get diagnostic metadata on a target.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Diagnostics include errors, warnings,
#' messages, runtimes, and other context/metadata from when a
#' target was built or an import was processed.
Expand Down Expand Up @@ -1294,7 +1294,7 @@ diagnose <- function(
}

#' @title List running targets.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description List the targets that either
#' 1. Are currently being built during a call to [make()], or
#' 2. Were in progress when [make()] was interrupted.
Expand Down Expand Up @@ -1328,7 +1328,7 @@ drake_running <- function(
}

#' @title List failed targets.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description List the targets that quit in error during [make()].
#' @seealso [drake_done()], [drake_running()], [drake_cancelled()],
#' [drake_progress()], [make()]
Expand Down Expand Up @@ -1362,7 +1362,7 @@ drake_failed <- function(
}

#' @title List done targets.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description List the targets that completed in the current or
#' previous call to [make()].
#' @seealso [drake_running()], [drake_failed()], [drake_cancelled()],
Expand All @@ -1383,7 +1383,7 @@ drake_done <- function(cache = drake::drake_cache(path = path), path = NULL) {
}

#' @title List cancelled targets.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description List the targets that were cancelled in the current or
#' previous call to [make()] using [cancel()] or [cancel_if()].
#' @seealso [running()], [failed()], [done()], [make()]
Expand Down Expand Up @@ -1411,7 +1411,7 @@ drake_progress_field <- function(cache, path, field) {
}

#' @title Get the build progress of your targets
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Objects that drake imported, built, or attempted
#' to build are listed as `"done"` or `"running"`.
#' Skipped objects are not listed.
Expand Down
8 changes: 4 additions & 4 deletions R/clean.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @title Invalidate and deregister targets.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Force targets to be out of date and remove target names
#' from the data in the cache. Be careful and run [which_clean()] before
#' [clean()]. That way, you know beforehand which targets will be
Expand Down Expand Up @@ -148,7 +148,7 @@ clean_cleanup <- function(cache, garbage_collection) {
}

#' @title Which targets will `clean()` invalidate?
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description `which_clean()` is a safety check for `clean()`.
#' It shows you the targets that `clean()` will
#' invalidate (or remove if `garbage_collection` is `TRUE`).
Expand Down Expand Up @@ -253,7 +253,7 @@ abort_gc <- function(path) {
}

#' @title Do garbage collection on the drake cache.
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Garbage collection removes obsolete target values
#' from the cache.
#' @details Caution: garbage collection *actually* removes data
Expand Down Expand Up @@ -317,7 +317,7 @@ keys_are_mangled <- function(cache) {

#' @title Try to repair a drake cache that is prone
#' to throwing `storr`-related errors.
#' \lifecycle{questioning}
#' `r lifecycle::badge("questioning")`
#' @description Sometimes, `storr` caches may have
#' dangling orphaned files that prevent you from loading or cleaning.
#' This function tries to remove those files so you can use the
Expand Down
4 changes: 2 additions & 2 deletions R/decorate_storr.R
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ dcst_set_move_tmp <- function(key, value, tmp, .self) {
}

#' @title drake tempfile
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description Create the path to a temporary file inside drake's cache.
#' @details This function is just like the `tempfile()` function in base R
#' except that the path points to a special location inside `drake`'s cache.
Expand Down Expand Up @@ -541,7 +541,7 @@ drake_tempfile <- function(
}

#' @title Show a file's encoded representation in the cache
#' \lifecycle{stable}
#' `r lifecycle::badge("stable")`
#' @description This function simply wraps literal double quotes around
#' the argument `x` so `drake` knows it is the name of a file.
#' Use when you are calling functions like `deps_code()`: for example,
Expand Down
Loading

0 comments on commit 4bf6b14

Please sign in to comment.