Replies: 3 comments 5 replies
-
I just tried with the global progression handler, instead of library(targets)
library(progressr)
handlers(global = TRUE)
handlers("debug") ## give details on all progression conditions received
tar_dir({
tar_script({
tar_option_set(packages = "progressr")
list(tar_target(slow, slow_sum(1:10, message = FALSE)))
}, ask = FALSE)
tar_make()
}) @wlandau, any comments? I don't know how targets handles conditions or a random class. Are they silently swallowed, or relayed? The progressr package signals conditions of class |
Beta Was this translation helpful? Give feedback.
-
Actually, I just found a discussion (ropensci/targets#661) where @wlandau explains that the integration of targets and progressr may be tricky and out of scope 😭 |
Beta Was this translation helpful? Give feedback.
-
When you call
So all the configuration of the progress bar needs to be inside In real life usage of The following example works on my end. # _targets.R file:
library(targets)
tar_option_set(packages = "progressr")
list(
tar_target(
slow, {
handlers("debug")
slow_sum(1:10)
}
)
) # R console:
tar_make()
#> • start target slow
#> M: Added value 1
#> M: Added value 2
#> M: Added value 3
#> M: Added value 4
#> M: Added value 5
#> M: Added value 6
#> M: Added value 7
#> M: Added value 8
#> M: Added value 9
#> M: Added value 10
#> • built target slow [10.128 seconds]
#> • end pipeline [10.208 seconds] |
Beta Was this translation helpful? Give feedback.
-
Dear all, I've decided to create this discussion since I have a (maybe silly) question: is it possible to use the
progressr
package within thetargets
framework? For example, when I run the following code on my Rstudio session I see the expected progress bar:However, I don't see anything when I run the following:
Am I doing something wrong? Is that known/expected? Is there any possible workaround? Thanks for your assistance!
Beta Was this translation helpful? Give feedback.
All reactions