-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
progressor(steps, props) #13
Comments
Allow for named steps and step sizes. |
Support for controlling step sizes will be useful when for instance processing a set of elements in chunks, where step sizes are proportional to the chunk size. For example, for |
Hi! I would very much like to see this feature. Any timeline for when this might be added? |
Sorry, no progress (pun intended) on this one. This is one of those things that requires long-term deep focus to get correct, especially since it's a matter of philosophy (e.g. "what does it really mean to do partial or weighted progress and what needs does it cover and what are we missing?") and design ("should it be absolute or relative step sizes, weights, or what?"). As soon as that is decided on/settled, then I think it'll be fairly quick to implement it. As soon as it's implemented, I think there's no going back and changing, so it's critical to get the design correct from the beginning. I'm not sure when I'll have time to deep into this one, but feel free to comment here how you would use it and expand on your needs and use cases. Then more people who do this, the easier it'll be to focus on what the design should be. |
Thanks for the quick update. I understand that this is not straightforward. My (current) use case is that the different tasks conducted in the lapply-call are not equally time consuming, first and foremost as involve different number of subtasks. See a constructed example below:
I would like the percentage to move by |
You can do: progressr::handlers(global = TRUE)
future::plan("sequential")
l <- list(1:3, 2:9, 5:7, 2, 3:4, 5:6)
str(l)
func <- function(x, p) {
Sys.sleep(length(x) / 2)
p(amount = length(x),
message = sprintf("Computation ongoing [n=%d]", length(x)))
x^2
}
progress_func <- function(l){
p <- progressr::progressor(sum(lengths(l)))
future.apply::future_lapply(l, func, p = p)
}
y <- progress_func(l) |
Thanks, this works like a charm! I obviously have a limited understanding of how |
Add support for realitive sizes of progression steps, e.g.
Alternatively,
where
steps = length(step_sizes)
by default.It would be neat if
props
can be modified along the way, e.g. if one of the steps end up finding a shortcut (because of input data) and only needing, say, 50% of its processing "time".The text was updated successfully, but these errors were encountered: