futureverse / futureverse/progressr

Adding a progress bar by default in a package

Open
#78 10 comments 7 reactions 0 assignees View on GitHub
question
Dominant language
R
Stars
299
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm slightly confused by this part of the documentation about `with_progress()`:

> IMPORTANT: This function is meant for end users only. It should not be used by R packages, which only task is to signal progress updates, not to decide if, when, and how progress should be reported.

I don't know whether it's because I don't fully understand everything about progressr or if it's a design choice where we may disagree.

Here is my use case:

I have a function that may take some time to run (couple dozens of minutes in most cases) and I would like to signal progress by default to users. Previously we were using the pbmcapply package but we moved away from it to get the flexibility from future (especially parallel processing on windows machines). In order to achieve this, we wrapped our `future_lapply()` loop with `with_progress()` in the function provided by our package.

Now my understanding is that if users don't like the progress bar, they can disable it by using `handlers("void")`. We even added a note in the function documentation to inform them of this option. (This is also a nice improvement compared to the previous pbmcapply solution.)

My issue with the approach you describe for progressr (the user should be in charge of using `with_progress()`) is that most users won't look into the docs and probably never bother adding the progress bar, even though they may enjoy it if they knew.

TL;DR: does it make sense to use `with_progress()` in a package to choose sensible defaults for the user?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.