Skip to content

Commit

Permalink
Better info
Browse files Browse the repository at this point in the history
  • Loading branch information
glwagner committed May 5, 2023
1 parent fd95561 commit 4afe922
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/EnsembleKalmanInversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,6 @@ function step_parameters(eki::EnsembleKalmanInversion, pseudo_stepping;
successes = findall(.!particle_failure)
some_failures = length(failures) > 0

some_failures && @info string(length(failures), " particles failed. ",
"Performing ensemble update with statistics from ",
length(successes), " successful particles.")

successful_Gⁿ = Gⁿ[:, successes]
successful_Xⁿ = Xⁿ[:, successes]

Expand All @@ -544,9 +540,15 @@ function step_parameters(eki::EnsembleKalmanInversion, pseudo_stepping;
sampled_Xⁿ⁺¹ = rand(new_X_distribution, length(failures))
Xⁿ⁺¹[:, failures] .= sampled_Xⁿ⁺¹
end

msg = @sprintf("Particles stepped adaptively. Iteration: %d, pseudotime: %.3e, pseudostep: %.3e",
eki.iteration, eki.pseudotime, Δt)

if some_failures
msg *= string(" (", length(failures), " failed, ", length(successes), " successful particles)")
end

intro = @sprintf("Particles stepped adaptively. Iteration: %d, pseudotime: %.3e, pseudostep: %.3e",
eki.iteration, eki.pseudotime, Δt)
@info msg

return Xⁿ⁺¹, Δt
end
Expand Down

0 comments on commit 4afe922

Please sign in to comment.