Skip to content

Commit

Permalink
test: fix remake tests for time-independent value providers
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Jan 23, 2025
1 parent 0f1d47f commit a08e4dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/remake_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ u0 = [1.0; 2.0; 3.0]
tspan = (0.0, 100.0)
p = [10.0, 20.0, 30.0]
sys = SymbolCache([:x, :y, :z], [:a, :b, :c], :t)
indep_sys = SymbolCache([:x, :y, :z], [:a, :b, :c])
fn = ODEFunction(lorenz!; sys)
for T in containerTypes
push!(probs, ODEProblem(fn, u0, tspan, T(p)))
Expand Down Expand Up @@ -64,7 +65,7 @@ function loss(x, p)
return sum(du)
end

fn = OptimizationFunction(loss; sys)
fn = OptimizationFunction(loss; sys = indep_sys)
for T in containerTypes
push!(probs, OptimizationProblem(fn, u0, T(p)))
end
Expand All @@ -73,7 +74,7 @@ function nllorenz!(du, u, p)
lorenz!(du, u, p, 0.0)
end

fn = NonlinearFunction(nllorenz!; sys)
fn = NonlinearFunction(nllorenz!; sys = indep_sys)
for T in containerTypes
push!(probs, NonlinearProblem(fn, u0, T(p)))
end
Expand Down

0 comments on commit a08e4dd

Please sign in to comment.