ProgressMeter in Pluto

I vaguely remember this being addressed in one of the many Pluto videos, but I am not sure. So my question is: can I use ProgressMeter, or something similar to show the progress of a loop inside a Pluto cell? Right now, there is no output at all from the code below. Ideally one would want to see a dynamic progress bar…

e.g.:

function test()
   @showprogress 1 "Computing..." for i in 1:50
       sleep(0.1)
   end
end
1 Like

Pluto has recently become compatible with https://github.com/JuliaLogging/ProgressLogging.jl, so just import this package, replace your macro @showprogress with @progress and you should be good to go!

6 Likes

I’d like to revive this question.

Is there a way to have a progress meter in Pluto that is compatible with parallelized code?

@progress for counter = 1:n
...
end

works fine, but

@progress Threads.@threads for counter = 1:n
...
end

does not work.

Thanks.

Edit: I guess this is covered by support loops wrapped by `Threads.@threads` · Issue #38 · JuliaLogging/ProgressLogging.jl · GitHub.
So is there either 1) a plan to address the issue above or 2) a plan to make ProgressMeter.jl work with Pluto (ProgressMeter is, apparently, thread-safe and compatible with Threads.@threads)?