Skip to content
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

Progress bar support for map_depth #1058

Open
dgromer opened this issue Feb 24, 2023 · 3 comments
Open

Progress bar support for map_depth #1058

dgromer opened this issue Feb 24, 2023 · 3 comments
Labels
feature a feature request or enhancement map 🗺️

Comments

@dgromer
Copy link
Contributor

dgromer commented Feb 24, 2023

With the current design of the map_depth function, would it be possible to also add progress bar support?

@DanChaltiel
Copy link

It seems that this is only a documentation issue.

map_depth(as.list(1:10), 1, ~{print(.x); Sys.sleep(1)}, .progress=T) works fine.

Sames apply for imap().

@dgromer
Copy link
Contributor Author

dgromer commented May 8, 2023

In your example, .progress is passed to map() via .... Since you use .depth = 1, it's not distinguishable whether the progress bar is from map_depth() or from map().

If you use, for example, .depth = 2 as in
map_depth(list(as.list(1:10), as.list(1:10)), 2, ~{print(.x); Sys.sleep(1)}, .progress=T)
you can see that the progress bars come from map(), not from map_depth()

@hadley hadley added feature a feature request or enhancement map 🗺️ labels Jul 26, 2023
@hadley
Copy link
Member

hadley commented Jul 26, 2023

It's probably possible to add it, it's just quite a bit of work. And it would have to be the style of progress bar where you don't know the total number of iterations, since computing that in advance is likely to be expensive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement map 🗺️
Projects
None yet
Development

No branches or pull requests

3 participants