Skip to content

Commit

Permalink
Merge pull request #557 from SciML/Vaibhavdixit02-patch-1
Browse files Browse the repository at this point in the history
Remove trajectories based `EnsembleProblem(::OptimizationProblem...)` method to avoid QMC dep
  • Loading branch information
ChrisRackauckas authored Dec 12, 2023
2 parents 0010a75 + 022811a commit ac664d1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Expand Down Expand Up @@ -83,7 +82,6 @@ Statistics = "1.9"
SymbolicIndexingInterface = "0.3"
Tables = "1.11"
TruncatedStacktraces = "1.4"
QuasiMonteCarlo = "0.2.19, 0.3"
Zygote = "0.6.67"
julia = "1.9"

Expand Down
2 changes: 1 addition & 1 deletion src/SciMLBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import EnumX
import TruncatedStacktraces
import ADTypes: AbstractADType
import FillArrays
import QuasiMonteCarlo

using Reexport
using SciMLOperators
using SciMLOperators:
Expand Down
11 changes: 0 additions & 11 deletions src/ensemble/ensemble_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ function SciMLBase.EnsembleProblem(prob::AbstractSciMLProblem, u0s::Vector{Vecto
return SciMLBase.EnsembleProblem(prob; prob_func, kwargs...)
end

#only makes sense for OptimizationProblem, might make sense for IntervalNonlinearProblem
function SciMLBase.EnsembleProblem(prob::OptimizationProblem, trajectories::Int; kwargs...)
if prob.lb !== nothing && prob.ub !== nothing
u0s = QuasiMonteCarlo.sample(trajectories, prob.lb, prob.ub, QuasiMonteCarlo.LatinHypercubeSample())
prob_func = (prob, i, repeat = nothing) -> remake(prob, u0 = u0s[:, i])
else
error("EnsembleProblem with `trajectories` as second argument requires lower and upper bounds to be defined in the `OptimizationProblem`.")
end
return SciMLBase.EnsembleProblem(prob; prob_func, kwargs...)
end

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

0 comments on commit ac664d1

Please sign in to comment.