Skip to content

Commit

Permalink
try to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepijn de Vos committed Oct 18, 2023
1 parent 45efdc5 commit ae30704
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/ensemble/basic_ensemble_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ $(TYPEDEF)
struct EnsembleSerial <: BasicEnsembleAlgorithm end

function merge_stats(us)
st = Iterators.filter(!isnothing, (x.stats for x in us))
st = Iterators.filter(!isnothing, (hasproperty(x, :stats) ? x.stats : nothing for x in us))
isempty(st) && return nothing
reduce(merge, st)
end

Expand Down Expand Up @@ -94,7 +95,7 @@ function __solve(prob::AbstractEnsembleProblem,
end
end
_u = tighten_container_eltype(u)
stats = prob.reduction === DEFAULT_REDUCTION ? merge_stats(_u) : nothing
stats = merge_stats(_u)
return EnsembleSolution(_u, elapsed_time, converged, stats)

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

View check run for this annotation

Codecov / codecov/patch

src/ensemble/basic_ensemble_solve.jl#L98-L99

Added lines #L98 - L99 were not covered by tests
end

Expand Down
2 changes: 1 addition & 1 deletion src/ensemble/ensemble_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct EnsembleSolution{T, N, S, U} <: AbstractEnsembleSolution{T, N, S}
converged::Bool
stats::U
end
function EnsembleSolution(sim, dims::NTuple{N}, elapsedTime, converged, stats=nothing) where {N}
function EnsembleSolution(sim, dims::NTuple{N}, elapsedTime, converged, stats) where {N}

Check warning on line 34 in src/ensemble/ensemble_solutions.jl

View check run for this annotation

Codecov / codecov/patch

src/ensemble/ensemble_solutions.jl#L34

Added line #L34 was not covered by tests
EnsembleSolution{eltype(eltype(sim)), N, typeof(sim), typeof(stats)}(sim, elapsedTime, converged, stats)
end
function EnsembleSolution(sim, elapsedTime, converged, stats=nothing)
Expand Down

0 comments on commit ae30704

Please sign in to comment.