Skip to content

Abstract progress bars #773

@njtierney

Description

@njtierney

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions