Skip to content

Commit

Permalink
only pass progress_id if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepijn de Vos committed Nov 2, 2023
1 parent 8db1dfe commit 3ed4b27
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/ensemble/basic_ensemble_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,14 @@ function batch_func(i, prob, alg; kwargs...)
new_prob = prob.prob_func(_prob, i, iter)
rerun = true

name = get(kwargs, :progress_name, "Ensemble")
progress_name = "$name #$i"
progress_id = Symbol("SciMLBase_$i")

x = prob.output_func(solve(new_prob, alg; progress_name, progress_id, kwargs...), i)
progress = get(kwargs, :progress, false)
if progress
name = get(kwargs, :progress_name, "Ensemble")
progress_name = "$name #$i"
progress_id = Symbol("SciMLBase_$i")
kwargs = (kwargs..., progress_name=progress_name, progress_id=progress_id)

Check warning on line 193 in src/ensemble/basic_ensemble_solve.jl

View check run for this annotation

Codecov / codecov/patch

src/ensemble/basic_ensemble_solve.jl#L190-L193

Added lines #L190 - L193 were not covered by tests
end
x = prob.output_func(solve(new_prob, alg; kwargs...), i)
if !(typeof(x) <: Tuple)
rerun_warn()
_x = (x, false)
Expand All @@ -201,7 +204,7 @@ function batch_func(i, prob, alg; kwargs...)
iter += 1
_prob = prob.safetycopy ? deepcopy(prob.prob) : prob.prob
new_prob = prob.prob_func(_prob, i, iter)
x = prob.output_func(solve(new_prob, alg; progress_name, progress_id, kwargs...), i)
x = prob.output_func(solve(new_prob, alg; kwargs...), i)
if !(typeof(x) <: Tuple)
rerun_warn()
_x = (x, false)
Expand Down

0 comments on commit 3ed4b27

Please sign in to comment.