-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Description
It is not clear to me why the following produces a syntax error.
Without ProgressMeter.@showprogress things work fine (see second line in the function me)
using Distributed
using ProgressMeter
function simulateSensitivity(sett,sensmatinput,i,get_metrics,tmpoutputfldr)
return nothing
end
function me(sensmatinput,tmpoutputfldr,get_metrics,sett,i)
keymetrics = ProgressMeter.@showprogress 2 "Running sensitivities..." Distributed.@distributed (vcat) for i in 1:size(sensmatinput,1) #does not work
#keymetrics = Distributed.@distributed (vcat) for i in 1:size(sensmatinput,1) #works
#do some work
sett = deepcopy(mainsett)
tmpoutputfldr = mkdir(joinpath(outputfld,string(i)))
#.......
keym = simulateSensitivity(sett,sensmatinput,i,get_metrics,tmpoutputfldr)
end
return nothing
end
ERROR: LoadError: ArgumentError: Final argument to @showprogress must be a for loop, comprehension, map, reduce, or pmap; got #= REPL[14]:2 =# Distributed.@distributed vcat for i = 1:size(sensmatinput, 1)
#= REPL[14]:5 =#
sett = deepcopy(mainsett)
#= REPL[14]:7 =#
for nm = sensmatnames
#= REPL[14]:8 =#
sclr = nmdict[nm]
#= REPL[14]:9 =#
sett.parametersDf[:, sclr] .= sensmatinput[i, nm]
end
#= REPL[14]:12 =#
tmpoutputfldr = mkdir(joinpath(outputfld, string(i)))
#= REPL[14]:14 =#
keym = simulateSensitivity(sett, sensmatinput, i, get_metrics, tmpoutputfldr)
end
Stacktrace:
[1] showprogress(::Int64, ::Vararg{Any, N} where N)
@ ProgressMeter C:\Users\bernhard.konig\.julia\packages\ProgressMeter\l7LEt\src\ProgressMeter.jl:862
[2] var"@showprogress"(__source__::LineNumberNode, __module__::Module, args::Vararg{Any, N} where N)
@ ProgressMeter C:\Users\bernhard.konig\.julia\packages\ProgressMeter\l7LEt\src\ProgressMeter.jl:817
in expression starting at REPL[14]:2
Metadata
Metadata
Assignees
Labels
No labels