Skip to content

Commit 6d98bff

Browse files
fixup! feat: support callable parameters
1 parent 75fd953 commit 6d98bff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/split_parameters.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ using ModelingToolkit: t_nounits as t, D_nounits as D
66
using ModelingToolkit: MTKParameters, ParameterIndex, NONNUMERIC_PORTION
77
using SciMLStructures: Tunable, Discrete, Constants
88
using StaticArrays: SizedVector
9+
using SymbolicIndexingInterface: is_parameter
910

1011
x = [1, 2.0, false, [1, 2, 3], Parameter(1.0)]
1112

@@ -229,11 +230,13 @@ end
229230
@mtkbuild sys = ODESystem(D(x) ~ fn(x), t, [x], [fn])
230231
@test is_parameter(sys, fn)
231232
@test ModelingToolkit.defaults(sys)[fn] == _f1
233+
232234
prob = ODEProblem(sys, [x => 1.0], (0.0, 1.0))
233235
@test_broken @inferred prob.ps[fn]
234236
@test_broken @inferred prob.f(prob.u0, prob.p, prob.tspan[1])
235237
sol = solve(prob; abstol = 1e-10, reltol = 1e-10)
236238
@test sol.u[end][] exp(2.0)
239+
237240
prob = ODEProblem(sys, [x => 1.0], (0.0, 1.0), [fn => Foo()])
238241
@test_broken @inferred prob.ps[fn]
239242
@test_broken @inferred prob.f(prob.u0, prob.p, prob.tspan[1])

0 commit comments

Comments
 (0)