Skip to content

Commit

Permalink
Merge pull request #525 from LilithHafner/lh/prepare
Browse files Browse the repository at this point in the history
Add input preparation to ensemble problems
  • Loading branch information
ChrisRackauckas authored Oct 18, 2023
2 parents 578352c + 681dad8 commit 50126b9
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)
end

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

0 comments on commit 50126b9

Please sign in to comment.