You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Brainstorming further, this could maybe be a Pkg extension: On loading ProgressMeter.jl we enable setting an option showprogress=true which automatically calls next! for each task/iteration.
p =Progress(100);
tforeach(1:100) do i
sleep(rand())
next!(p)
end
Of course, people could always do this themselves, especially if they have to load ProgressMeter manually anyways.
We could open a PR with ProgressMeter.jl to fix their implementation of @showprogress to make it extensible.
Currently, they detect just based on the AST if the mapping function is allowed:
julia>@macroexpand@showprogressmap(f, 1:10)
:(ProgressMeter.progress_map(f, 1:10, progress = ProgressMeter.Progress(ProgressMeter.ncalls(map, (f, 1:10))), mapfun = map))
julia>@macroexpand@showprogresstmap(f, 1:10)
ERROR: ArgumentError: Final argument to @showprogress must be a for loop, comprehension, map, reduce, or pmap; got tmap(f, 1:10)
Stacktrace:
This really should instead be checked when the types are known, not during macroexpansion I think.
https://github.com/timholy/ProgressMeter.jl is essentially thread safe.
The text was updated successfully, but these errors were encountered: