Skip to content

Commit

Permalink
add input preparation to ensemble problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilith Hafner authored and Lilith Hafner committed Oct 18, 2023
1 parent 578352c commit 681dad8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ensemble/ensemble_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,25 @@ function EnsembleProblem(prob::AbstractVector{<:AbstractSciMLProblem}; kwargs...
kwargs...)
end
function EnsembleProblem(prob;
output_func = DEFAULT_OUTPUT_FUNC,
prob_func = DEFAULT_PROB_FUNC,
output_func = DEFAULT_OUTPUT_FUNC,
reduction = DEFAULT_REDUCTION,
u_init = nothing,
safetycopy = prob_func !== DEFAULT_PROB_FUNC)
EnsembleProblem(prob, prob_func, output_func, reduction, u_init, safetycopy)
_prob_func = prepare_function(prob_func)
_output_func = prepare_function(output_func)
_reduction = prepare_function(reduction)
_u_init = prepare_initial_state(u_init)
EnsembleProblem(prob, _prob_func, _output_func, _reduction, _u_init, safetycopy)
end

function EnsembleProblem(; prob,
output_func = DEFAULT_OUTPUT_FUNC,
prob_func = DEFAULT_PROB_FUNC,
output_func = DEFAULT_OUTPUT_FUNC,
reduction = DEFAULT_REDUCTION,
u_init = nothing, p = nothing,
safetycopy = prob_func !== DEFAULT_PROB_FUNC)
EnsembleProblem(prob, prob_func, output_func, reduction, u_init, safetycopy)
EnsembleProblem(prob; prob_func, output_func, reduction, u_init, safetycopy)

Check warning on line 44 in src/ensemble/ensemble_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/ensemble/ensemble_problems.jl#L44

Added line #L44 was not covered by tests
end

struct WeightedEnsembleProblem{T1 <: AbstractEnsembleProblem, T2 <: AbstractVector} <:
Expand Down

0 comments on commit 681dad8

Please sign in to comment.