From 599c278943d7bc139c906c3b0fedb2a68c963c7a Mon Sep 17 00:00:00 2001 From: wlandau Date: Thu, 9 Jan 2025 15:58:10 -0500 Subject: [PATCH] docs --- R/class_forecast.R | 10 +++++++--- R/class_outdated.R | 9 +++++---- R/class_reporter.R | 2 +- R/class_silent.R | 3 +-- R/tar_config_set.R | 7 +++++++ R/tar_make.R | 8 +++++++- man/tar_config_set.Rd | 11 +++++++++-- man/tar_make.Rd | 10 ++++++++-- man/tar_make_clustermq.Rd | 10 ++++++++-- man/tar_make_future.Rd | 10 ++++++++-- man/tar_mermaid.Rd | 4 +++- man/tar_network.Rd | 4 +++- man/tar_outdated.Rd | 4 +++- man/tar_sitrep.Rd | 4 +++- man/tar_visnetwork.Rd | 4 +++- 15 files changed, 76 insertions(+), 24 deletions(-) diff --git a/R/class_forecast.R b/R/class_forecast.R index 50c19f269..9cbfb6dd6 100644 --- a/R/class_forecast.R +++ b/R/class_forecast.R @@ -15,9 +15,13 @@ forecast_class <- R6::R6Class( self$buffer <- NULL } }, - report_outdated = function(outdated) { - self$buffer <- cli_forecast(outdated$cli_data(), print = FALSE) - self$poll() + report_outdated = function(outdated, force = FALSE) { + now <- time_seconds_local() + if (force || ((now - seconds_flushed) > seconds_interval)) { + self$buffer <- cli_forecast(outdated$cli_data(), print = FALSE) + flush_messages() + self$seconds_flushed <- now + } }, report_end = function(progress = NULL, seconds_elapsed = NULL) { self$flush_messages() diff --git a/R/class_outdated.R b/R/class_outdated.R index 3bed109dc..77ed41f38 100644 --- a/R/class_outdated.R +++ b/R/class_outdated.R @@ -172,11 +172,11 @@ outdated_class <- R6::R6Class( target <- pipeline_get_target(pipeline, name) if_any( inherits(target, "tar_pattern"), - self$process_pattern(target), - self$process_builder(target) + process_pattern(target), + process_builder(target) ) - self$register_checked(name) - self$scheduler$reporter$report_outdated(self) + register_checked(name) + scheduler$reporter$report_outdated(self) }, run = function() { self$start() @@ -188,6 +188,7 @@ outdated_class <- R6::R6Class( name <- dequeue() self$process_target(name, pipeline) } + self$scheduler$reporter$report_outdated(self, force = TRUE) self$end() }, validate = function() { diff --git a/R/class_reporter.R b/R/class_reporter.R index 7c55792d7..773a5a6af 100644 --- a/R/class_reporter.R +++ b/R/class_reporter.R @@ -67,7 +67,7 @@ reporter_class <- R6::R6Class( }, report_canceled = function(target = NULL, progress = NULL) { }, - report_outdated = function(outdated) { + report_outdated = function(outdated, force = FALSE) { }, report_workspace = function(target) { }, diff --git a/R/class_silent.R b/R/class_silent.R index d2be8db9b..bbf023aab 100644 --- a/R/class_silent.R +++ b/R/class_silent.R @@ -7,6 +7,5 @@ silent_class <- R6::R6Class( inherit = reporter_class, class = FALSE, portable = FALSE, - cloneable = FALSE, - public = list() + cloneable = FALSE ) diff --git a/R/tar_config_set.R b/R/tar_config_set.R index 7ef80099e..a106a771a 100644 --- a/R/tar_config_set.R +++ b/R/tar_config_set.R @@ -84,6 +84,10 @@ #' When the pipeline ends, #' all the metadata and progress data is saved immediately, #' regardless of `seconds_meta_append`. +#' +#' When the pipeline is just skipping targets, the actual interval +#' between saves is `max(1, seconds_meta_append)` to reduce +#' overhead. #' @param seconds_meta_upload Argument of [tar_make()], [tar_make_clustermq()], #' and [tar_make_future()]. #' Positive numeric of length 1 with the minimum @@ -100,6 +104,9 @@ #' number of seconds between times when the reporter prints progress #' messages to the R console (for the aforementioned #' [tar_make()]-like functions only). +#' When the pipeline is just skipping targets, +#' the actual interval between messages is `max(1, seconds_reporter)` +#' to reduce overhead. #' @param seconds_reporter_outdated Argument of [tar_outdated()] #' and other related functions that do not run the pipeline. #' Positive numeric of length 1 with the minimum diff --git a/R/tar_make.R b/R/tar_make.R index 2d8fb8e39..c1c6be68a 100644 --- a/R/tar_make.R +++ b/R/tar_make.R @@ -58,6 +58,10 @@ #' When the pipeline ends, #' all the metadata and progress data is saved immediately, #' regardless of `seconds_meta_append`. +#' +#' When the pipeline is just skipping targets, the actual interval +#' between saves is `max(1, seconds_meta_append)` to reduce +#' overhead. #' @param seconds_meta_upload Positive numeric of length 1 with the minimum #' number of seconds between uploads of the metadata and progress data #' to the cloud @@ -69,7 +73,9 @@ #' regardless of `seconds_meta_upload`. #' @param seconds_reporter Positive numeric of length 1 with the minimum #' number of seconds between times when the reporter prints progress -#' messages to the R console. +#' messages to the R console. When the pipeline is just skipping targets, +#' the actual interval between messages is `max(1, seconds_reporter)` +#' to reduce overhead. #' @param garbage_collection Deprecated. Use the `garbage_collection` #' argument of [tar_option_set()] instead to run garbage collection #' at regular intervals in a pipeline, or use the argument of the same diff --git a/man/tar_config_set.Rd b/man/tar_config_set.Rd index 24d1e7eb5..607710ca3 100644 --- a/man/tar_config_set.Rd +++ b/man/tar_config_set.Rd @@ -85,7 +85,11 @@ Higher values generally make the pipeline run faster, but unsaved work (in the event of a crash) is not up to date. When the pipeline ends, all the metadata and progress data is saved immediately, -regardless of \code{seconds_meta_append}.} +regardless of \code{seconds_meta_append}. + +When the pipeline is just skipping targets, the actual interval +between saves is \code{max(1, seconds_meta_append)} to reduce +overhead.} \item{seconds_meta_upload}{Argument of \code{\link[=tar_make]{tar_make()}}, \code{\link[=tar_make_clustermq]{tar_make_clustermq()}}, and \code{\link[=tar_make_future]{tar_make_future()}}. @@ -103,7 +107,10 @@ regardless of \code{seconds_meta_upload}.} and \code{\link[=tar_make_future]{tar_make_future()}}. Positive numeric of length 1 with the minimum number of seconds between times when the reporter prints progress messages to the R console (for the aforementioned -\code{\link[=tar_make]{tar_make()}}-like functions only).} +\code{\link[=tar_make]{tar_make()}}-like functions only). +When the pipeline is just skipping targets, +the actual interval between messages is \code{max(1, seconds_reporter)} +to reduce overhead.} \item{seconds_reporter_outdated}{Argument of \code{\link[=tar_outdated]{tar_outdated()}} and other related functions that do not run the pipeline. diff --git a/man/tar_make.Rd b/man/tar_make.Rd index 10e9a3443..476897f15 100644 --- a/man/tar_make.Rd +++ b/man/tar_make.Rd @@ -69,7 +69,11 @@ Higher values generally make the pipeline run faster, but unsaved work (in the event of a crash) is not up to date. When the pipeline ends, all the metadata and progress data is saved immediately, -regardless of \code{seconds_meta_append}.} +regardless of \code{seconds_meta_append}. + +When the pipeline is just skipping targets, the actual interval +between saves is \code{max(1, seconds_meta_append)} to reduce +overhead.} \item{seconds_meta_upload}{Positive numeric of length 1 with the minimum number of seconds between uploads of the metadata and progress data @@ -83,7 +87,9 @@ regardless of \code{seconds_meta_upload}.} \item{seconds_reporter}{Positive numeric of length 1 with the minimum number of seconds between times when the reporter prints progress -messages to the R console.} +messages to the R console. When the pipeline is just skipping targets, +the actual interval between messages is \code{max(1, seconds_reporter)} +to reduce overhead.} \item{seconds_interval}{Deprecated on 2023-08-24 (targets version 1.2.2.9001). diff --git a/man/tar_make_clustermq.Rd b/man/tar_make_clustermq.Rd index 1c603319e..df7fda8a9 100644 --- a/man/tar_make_clustermq.Rd +++ b/man/tar_make_clustermq.Rd @@ -68,7 +68,11 @@ Higher values generally make the pipeline run faster, but unsaved work (in the event of a crash) is not up to date. When the pipeline ends, all the metadata and progress data is saved immediately, -regardless of \code{seconds_meta_append}.} +regardless of \code{seconds_meta_append}. + +When the pipeline is just skipping targets, the actual interval +between saves is \code{max(1, seconds_meta_append)} to reduce +overhead.} \item{seconds_meta_upload}{Positive numeric of length 1 with the minimum number of seconds between uploads of the metadata and progress data @@ -82,7 +86,9 @@ regardless of \code{seconds_meta_upload}.} \item{seconds_reporter}{Positive numeric of length 1 with the minimum number of seconds between times when the reporter prints progress -messages to the R console.} +messages to the R console. When the pipeline is just skipping targets, +the actual interval between messages is \code{max(1, seconds_reporter)} +to reduce overhead.} \item{seconds_interval}{Deprecated on 2023-08-24 (targets version 1.2.2.9001). diff --git a/man/tar_make_future.Rd b/man/tar_make_future.Rd index 8fdb6af1a..79fafb815 100644 --- a/man/tar_make_future.Rd +++ b/man/tar_make_future.Rd @@ -68,7 +68,11 @@ Higher values generally make the pipeline run faster, but unsaved work (in the event of a crash) is not up to date. When the pipeline ends, all the metadata and progress data is saved immediately, -regardless of \code{seconds_meta_append}.} +regardless of \code{seconds_meta_append}. + +When the pipeline is just skipping targets, the actual interval +between saves is \code{max(1, seconds_meta_append)} to reduce +overhead.} \item{seconds_meta_upload}{Positive numeric of length 1 with the minimum number of seconds between uploads of the metadata and progress data @@ -82,7 +86,9 @@ regardless of \code{seconds_meta_upload}.} \item{seconds_reporter}{Positive numeric of length 1 with the minimum number of seconds between times when the reporter prints progress -messages to the R console.} +messages to the R console. When the pipeline is just skipping targets, +the actual interval between messages is \code{max(1, seconds_reporter)} +to reduce overhead.} \item{seconds_interval}{Deprecated on 2023-08-24 (targets version 1.2.2.9001). diff --git a/man/tar_mermaid.Rd b/man/tar_mermaid.Rd index 738be093b..b083e359f 100644 --- a/man/tar_mermaid.Rd +++ b/man/tar_mermaid.Rd @@ -97,7 +97,9 @@ targets found so far.} \item{seconds_reporter}{Positive numeric of length 1 with the minimum number of seconds between times when the reporter prints progress -messages to the R console.} +messages to the R console. When the pipeline is just skipping targets, +the actual interval between messages is \code{max(1, seconds_reporter)} +to reduce overhead.} \item{callr_function}{A function from \code{callr} to start a fresh clean R process to do the work. Set to \code{NULL} to run in the current session diff --git a/man/tar_network.Rd b/man/tar_network.Rd index c3cc0283f..19eeb3c98 100644 --- a/man/tar_network.Rd +++ b/man/tar_network.Rd @@ -77,7 +77,9 @@ targets found so far.} \item{seconds_reporter}{Positive numeric of length 1 with the minimum number of seconds between times when the reporter prints progress -messages to the R console.} +messages to the R console. When the pipeline is just skipping targets, +the actual interval between messages is \code{max(1, seconds_reporter)} +to reduce overhead.} \item{callr_function}{A function from \code{callr} to start a fresh clean R process to do the work. Set to \code{NULL} to run in the current session diff --git a/man/tar_outdated.Rd b/man/tar_outdated.Rd index b1d3cded7..5654529c5 100644 --- a/man/tar_outdated.Rd +++ b/man/tar_outdated.Rd @@ -59,7 +59,9 @@ targets found so far.} \item{seconds_reporter}{Positive numeric of length 1 with the minimum number of seconds between times when the reporter prints progress -messages to the R console.} +messages to the R console. When the pipeline is just skipping targets, +the actual interval between messages is \code{max(1, seconds_reporter)} +to reduce overhead.} \item{seconds_interval}{Deprecated on 2023-08-24 (targets version 1.2.2.9001). diff --git a/man/tar_sitrep.Rd b/man/tar_sitrep.Rd index a498a6f2d..1220a1f0f 100644 --- a/man/tar_sitrep.Rd +++ b/man/tar_sitrep.Rd @@ -93,7 +93,9 @@ targets found so far.} \item{seconds_reporter}{Positive numeric of length 1 with the minimum number of seconds between times when the reporter prints progress -messages to the R console.} +messages to the R console. When the pipeline is just skipping targets, +the actual interval between messages is \code{max(1, seconds_reporter)} +to reduce overhead.} \item{callr_function}{A function from \code{callr} to start a fresh clean R process to do the work. Set to \code{NULL} to run in the current session diff --git a/man/tar_visnetwork.Rd b/man/tar_visnetwork.Rd index cf8b64ca6..28f9b00ac 100644 --- a/man/tar_visnetwork.Rd +++ b/man/tar_visnetwork.Rd @@ -118,7 +118,9 @@ targets found so far.} \item{seconds_reporter}{Positive numeric of length 1 with the minimum number of seconds between times when the reporter prints progress -messages to the R console.} +messages to the R console. When the pipeline is just skipping targets, +the actual interval between messages is \code{max(1, seconds_reporter)} +to reduce overhead.} \item{callr_function}{A function from \code{callr} to start a fresh clean R process to do the work. Set to \code{NULL} to run in the current session