greta-dev / greta-dev/greta

Abstract progress bars

Open
#773 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
607
Forks
67
Avg merge
3d 8h
Merged PRs (30d)
1

Description

I think it might be possible to turn bits of code like:

```r
if (verbose) {
pb_warmup <- create_progress_bar(
phase = "warmup",
iter = c(self$warmup, n_samples),
pb_update = pb_update,
width = self$pb_width
)

iterate_progress_bar(
pb = pb_warmup,
it = 0,
rejects = 0,
chains = self$n_chains,
file = self$pb_file
)
} else {
```

into something like

```r
pb_warmup <- create_progress_bar_warmup()
iterate_progress_bar(pb_warmup, 0, 0)
```

Perhaps by putting a couple of objects into the slots of R6 objects? It's a small change, but it happens in a couple of places and it might just be another small thing to improve clarity when viewing the code

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.