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

Abstract progress bars #773

Open
njtierney opened this issue Mar 11, 2025 · 0 comments
Open

Abstract progress bars #773

njtierney opened this issue Mar 11, 2025 · 0 comments

Comments

@njtierney
Copy link
Collaborator

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

        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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant