timholy / timholy/ProgressMeter.jl

Make @showprogress update on inner loop when using nested loops

Open
#239 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
789
Forks
91
PR merge metrics
No merged PRs in 30d

Description

I like the @showprogress macro very much, though I think it does not work well with nested loops. What I mean: I would expect the progress bar created with

@showprogress for j in 1:10, i in 1:10
    sleep(.1)
end

to behave exactly like

@showprogress for ij in 1:100
    sleep(.1)
end

, ie filling up with 1-percent increments. Instead, the progress bar from the first example fills up with 10-percent increments, ie is analogous to

@showprogress for j in 1:10
    for i in 1:10
        sleep(.1)
    end
end

I am not sure if this is possible, but I think in such cases it would be very nice to have the macro determine the overall number of iterations of the innermost loop in order to have less waiting time between updates.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the @showprogress macro implementation and inspect how nested iteration is represented. Run the two nested-loop examples from the issue, then make the progress bar update in 1-percent increments like the single 1:100 loop and verify that behavior with the same examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.