Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trajectories based EnsembleProblem(::OptimizationProblem...) method to avoid QMC dep #557

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2"
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
Loading