Skip to content

Commit fb73106

Browse files
Merge pull request #1089 from ChrisRackauckas/fix-formatting
Apply JuliaFormatter to fix code formatting
2 parents 1aeb148 + a32423f commit fb73106

10 files changed

+94
-61
lines changed

ext/SciMLBaseChainRulesCoreExt.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,17 @@ end
141141
# `back` explicitly while already in a reverse pass causing a nested gradient call. The mutable struct
142142
# causes accumulation anytime `getfield/property` is called, accumulating multiple times. This tries to treat
143143
# AbstractDEProblem as immutable for the purposes of reverse mode AD.
144-
function ChainRulesCore.rrule(::ChainRulesCore.RuleConfig{>:ChainRulesCore.HasReverseMode}, ::typeof(Base.getproperty), x::NonlinearProblem, f::Symbol)
144+
function ChainRulesCore.rrule(::ChainRulesCore.RuleConfig{>:ChainRulesCore.HasReverseMode},
145+
::typeof(Base.getproperty), x::NonlinearProblem, f::Symbol)
145146
val = getfield(x, f)
146147
function back(der)
147148
dx = if der === nothing
148149
ChainRulesCore.zero_tangent(x)
149150
else
150151
NamedTuple{(f,)}((der,))
151152
end
152-
return (ChainRulesCore.NoTangent(), ChainRulesCore.ProjectTo(x)(dx), ChainRulesCore.NoTangent())
153+
return (ChainRulesCore.NoTangent(), ChainRulesCore.ProjectTo(x)(dx),
154+
ChainRulesCore.NoTangent())
153155
end
154156
return val, back
155157
end

src/problems/bvp_problems.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ struct BVProblem{uType, tType, isinplace, nlls, P, F, LC, UC, PT, K} <:
174174
_nlls = _unwrap_val(nlls)
175175
end
176176

177-
return new{typeof(_u0), typeof(_tspan), iip, _nlls, typeof(p), typeof(f), typeof(lcons), typeof(ucons),
178-
typeof(problem_type), typeof(kwargs)}(f, _u0, _tspan, p, lcons, ucons, problem_type, kwargs)
177+
return new{typeof(_u0), typeof(_tspan), iip, _nlls, typeof(p),
178+
typeof(f), typeof(lcons), typeof(ucons),
179+
typeof(problem_type), typeof(kwargs)}(
180+
f, _u0, _tspan, p, lcons, ucons, problem_type, kwargs)
179181
end
180182

181183
function BVProblem{iip}(f, bc, u0, tspan, p = NullParameters(); kwargs...) where {iip}

src/problems/linear_problems.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ function SymbolicIndexingInterface.observed(fn::SymbolicLinearInterface, sym)
4747
end
4848
end
4949

50-
5150
@doc doc"""
5251
5352
Defines a linear system problem.
@@ -104,7 +103,8 @@ parameters. Any extra keyword arguments are passed on to the solvers.
104103
generated by a symbolic backend.
105104
* `kwargs`: The keyword arguments passed on to the solvers.
106105
"""
107-
struct LinearProblem{uType, isinplace, F, bType, P, I <: Union{SymbolicLinearInterface, Nothing}, K} <:
106+
struct LinearProblem{
107+
uType, isinplace, F, bType, P, I <: Union{SymbolicLinearInterface, Nothing}, K} <:
108108
AbstractLinearProblem{bType, isinplace}
109109
A::F
110110
b::bType
@@ -115,7 +115,8 @@ struct LinearProblem{uType, isinplace, F, bType, P, I <: Union{SymbolicLinearInt
115115
@add_kwonly function LinearProblem{iip}(A, b, p = NullParameters(); u0 = nothing,
116116
f = nothing, kwargs...) where {iip}
117117
warn_paramtype(p)
118-
new{typeof(u0), iip, typeof(A), typeof(b), typeof(p), typeof(f), typeof(kwargs)}(A, b, u0, p,
118+
new{typeof(u0), iip, typeof(A), typeof(b), typeof(p), typeof(f), typeof(kwargs)}(
119+
A, b, u0, p,
119120
f, kwargs)
120121
end
121122
end
@@ -134,7 +135,9 @@ SymbolicIndexingInterface.symbolic_container(prob::LinearProblem) = prob.f
134135
SymbolicIndexingInterface.state_values(prob::LinearProblem) = prob.u0
135136
SymbolicIndexingInterface.parameter_values(prob::LinearProblem) = prob.p
136137
SymbolicIndexingInterface.is_time_dependent(::LinearProblem) = false
137-
function SymbolicIndexingInterface.set_parameter!(valp::LinearProblem{A, B, C, D, E, <:SymbolicLinearInterface}, val, idx) where {A, B, C, D, E}
138+
function SymbolicIndexingInterface.set_parameter!(
139+
valp::LinearProblem{A, B, C, D, E, <:SymbolicLinearInterface},
140+
val, idx) where {A, B, C, D, E}
138141
set_parameter!(parameter_values(valp), val, idx)
139142
valp.f.update_A!(valp.A, valp.p)
140143
valp.f.update_b!(valp.b, valp.p)

src/scimlfunctions.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,8 @@ For more details on this argument, see the ODEFunction documentation.
23182318
23192319
The fields of the BVPFunction type directly match the names of the inputs.
23202320
"""
2321-
struct BVPFunction{iip, specialize, twopoint, F, BF, C, EC, IC, TMM, Ta, Tt, TJ, BCTJ, JVP, VJP,
2321+
struct BVPFunction{
2322+
iip, specialize, twopoint, F, BF, C, EC, IC, TMM, Ta, Tt, TJ, BCTJ, JVP, VJP,
23222323
JP, BCJP, BCRP, SP, TW, TWt, TPJ, O, TCV, BCTCV,
23232324
SYS, ID} <: AbstractBVPFunction{iip, twopoint}
23242325
f::F
@@ -2663,7 +2664,6 @@ end
26632664
end
26642665
end
26652666

2666-
26672667
(f::SDDEFunction)(args...) = f.f(args...)
26682668
(f::SplitSDEFunction)(u, p, t) = f.f1(u, p, t) + f.f2(u, p, t)
26692669

@@ -4462,7 +4462,8 @@ function BVPFunction{iip, specialize, twopoint}(f, bc;
44624462
paramjaciip = paramjac !== nothing ? isinplace(paramjac, 4, "paramjac", iip) : iip
44634463
costiip = cost !== nothing ? isinplace(cost, 2, "cost", iip) : iip
44644464
equalityiip = equality !== nothing ? isinplace(equality, 3, "equality", iip) : iip
4465-
inequalityiip = inequality !== nothing ? isinplace(inequality, 3, "inequality", iip) : iip
4465+
inequalityiip = inequality !== nothing ? isinplace(inequality, 3, "inequality", iip) :
4466+
iip
44664467

44674468
nonconforming = (bciip, jaciip, tgradiip, jvpiip, vjpiip, Wfactiip, Wfact_tiip,
44684469
paramjaciip, costiip, equalityiip, inequalityiip) .!= iip

src/solve.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ end
4343

4444
"""
4545
```julia
46-
solve(prob::OptimizationProblem, alg::AbstractOptimizationAlgorithm, args...; kwargs...)::OptimizationSolution
46+
solve(prob::OptimizationProblem, alg::AbstractOptimizationAlgorithm,
47+
args...; kwargs...)::OptimizationSolution
4748
```
4849
4950
For information about the returned solution object, refer to the documentation for [OptimizationSolution](@ref)
@@ -152,7 +153,8 @@ function _check_opt_alg(prob::OptimizationProblem, alg; kwargs...)
152153
requiresconstraints(alg) && isnothing(prob.f.cons) &&
153154
throw(IncompatibleOptimizerError("The algorithm $(typeof(alg)) requires constraints, pass them with the `cons` kwarg in `OptimizationFunction`."))
154155
# Check that if constraints are present and the algorithm supports constraints, both lcons and ucons are provided
155-
allowsconstraints(alg) && !isnothing(prob.f.cons) && (isnothing(prob.lcons) || isnothing(prob.ucons)) &&
156+
allowsconstraints(alg) && !isnothing(prob.f.cons) &&
157+
(isnothing(prob.lcons) || isnothing(prob.ucons)) &&
156158
throw(ArgumentError("Constrained optimization problem requires both `lcons` and `ucons` to be provided to OptimizationProblem. " *
157159
"Example: OptimizationProblem(optf, u0, p; lcons=[-Inf], ucons=[0.0])"))
158160
!allowscallback(alg) && haskey(kwargs, :callback) &&

test/downstream/comprehensive_indexing.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ begin
4343
osys = complete(System(diff_eqs, t; observed = obs, name = :osys))
4444
ssys = complete(System(
4545
diff_eqs, t, [X, Y], [kp, kd, k1, k2]; noise_eqs, observed = obs, name = :ssys))
46-
jsys = complete(JumpSystem(jumps, t, [X, Y], [kp, kd, k1, k2]; observed = obs, name = :jsys))
46+
jsys = complete(JumpSystem(
47+
jumps, t, [X, Y], [kp, kd, k1, k2]; observed = obs, name = :jsys))
4748
nsys = complete(System(alg_eqs; observed = obs, name = :nsys))
4849
optsys = complete(OptimizationSystem(
4950
loss, [X, Y], [kp, kd, k1, k2]; observed = obs, name = :optsys))

test/downstream/modelingtoolkit_remake.jl

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,12 @@ end
157157
@testset "DiscreteProblem" begin
158158
k = ShiftIndex(t)
159159
@mtkcompile discsys = System(
160-
[x ~ x(k - 1) * ρ + y(k - 2), y ~ y(k - 1) * σ - z(k - 2), z ~ z(k - 1) * β + x(k - 2)],
161-
t; defaults = [x => 1.0, y => 1.0, z => 1.0, x(k-1) => 0.0, y(k-1) => 0.0, z(k-1) => 0.0])
160+
[
161+
x ~ x(k - 1) * ρ + y(k - 2), y ~ y(k - 1) * σ - z(k - 2), z ~
162+
z(k - 1) * β +
163+
x(k - 2)],
164+
t; defaults = [
165+
x => 1.0, y => 1.0, z => 1.0, x(k-1) => 0.0, y(k-1) => 0.0, z(k-1) => 0.0])
162166
prob = DiscreteProblem(discsys, p, (0, 10))
163167
prob[x(k-1)] = 1.0
164168
prob[y(k-1)] = prob[z(k-1)] = 0.0
@@ -168,13 +172,16 @@ end
168172

169173
baseType = Base.typename(typeof(prob)).wrapper
170174
ugetter = getsym(prob, [x(k-1), y(k-1), z(k-1)])
171-
prob2 = @inferred baseType remake(prob; u0 = [x(k-1) => 2.0, y(k-1) => 3.0, z(k-1) => 4.0])
175+
prob2 = @inferred baseType remake(prob; u0 = [
176+
x(k-1) => 2.0, y(k-1) => 3.0, z(k-1) => 4.0])
172177
@test ugetter(prob2) == [2.0, 3.0, 4.0]
173-
prob2 = @inferred baseType remake(prob; u0 = [sys.x(k-1) => 2.0, sys.y(k-1) => 3.0, sys.z(k-1) => 4.0])
178+
prob2 = @inferred baseType remake(prob; u0 = [
179+
sys.x(k-1) => 2.0, sys.y(k-1) => 3.0, sys.z(k-1) => 4.0])
174180
@test ugetter(prob2) == [2.0, 3.0, 4.0]
175181
prob2 = @inferred baseType remake(prob; u0 = [:xₜ₋₁ => 2.0, :yₜ₋₁ => 3.0, :zₜ₋₁ => 4.0])
176182
@test ugetter(prob2) == [2.0, 3.0, 4.0]
177-
prob2 = @inferred baseType remake(prob; u0 = [x(k-1) => 2.0, sys.y(k-1) => 3.0, :zₜ₋₁ => 4.0])
183+
prob2 = @inferred baseType remake(prob; u0 = [
184+
x(k-1) => 2.0, sys.y(k-1) => 3.0, :zₜ₋₁ => 4.0])
178185
@test ugetter(prob2) == [2.0, 3.0, 4.0]
179186

180187
prob2 = @inferred baseType remake(prob; u0 = [x(k-1) => 12.0])
@@ -232,7 +239,8 @@ end
232239
@test ugetter(prob2) [15.0, 0.0, 0.0]
233240

234241
# Test u0 dependent on p and p dependent on u0
235-
prob2 = @inferred baseType remake(prob; u0 = [x(k-1) => 0.5σ + 1], p ==> 0.5x(k-1) + 1])
242+
prob2 = @inferred baseType remake(prob; u0 = [x(k-1) => 0.5σ + 1], p ==> 0.5x(k-1) +
243+
1])
236244
@test ugetter(prob2) [15.0, 0.0, 0.0]
237245
@test_broken pgetter(prob2) [28.0, 8.5, 10.0]
238246
prob2 = @inferred baseType remake(

test/downstream/solution_interface.jl

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ using Plots: Plots, plot
99
@testset "Basic indexing" begin
1010
@parameters a b c d
1111
@variables s1(t) s2(t)
12-
12+
1313
eqs = [D(s1) ~ a * s1 / (1 + s1 + s2) - b * s1,
1414
D(s2) ~ +c * s2 / (1 + s1 + s2) - d * s2]
15-
15+
1616
@mtkcompile population_model = System(eqs, t)
17-
17+
1818
# Tests on ODEProblem.
1919
u0 = [s1 => 2.0, s2 => 1.0]
2020
p = [a => 2.0, b => 1.0, c => 1.0, d => 1.0]
2121
tspan = (0.0, 1000000.0)
2222
oprob = ODEProblem(population_model, [u0; p], tspan)
2323
sol = solve(oprob, Rodas4())
24-
24+
2525
@test sol[s1] == sol[population_model.s1] == sol[:s1]
2626
@test sol[s2] == sol[population_model.s2] == sol[:s2]
2727
@test sol[s1][end] 1.0
@@ -57,93 +57,94 @@ using Plots: Plots, plot
5757
noisy_population_model = complete(noisy_population_model)
5858
sprob = SDEProblem(noisy_population_model, [u0; p], (0.0, 100.0))
5959
sol = solve(sprob, ImplicitEM())
60-
60+
6161
@test sol[s1] == sol[noisy_population_model.s1] == sol[:s1]
6262
@test sol[s2] == sol[noisy_population_model.s2] == sol[:s2]
6363
@test_throws Exception sol[a]
6464
@test_throws Exception sol[noisy_population_model.a]
6565
@test_throws Exception sol[:a]
6666
@test_nowarn sol(0.5, idxs = noisy_population_model.s1)
6767
### Tests on layered model (some things should not work). ###
68-
68+
6969
@parameters σ ρ β
7070
@variables x(t) y(t) z(t)
71-
71+
7272
eqs = [D(x) ~ σ * (y - x),
7373
D(y) ~ x *- z) - y,
7474
D(z) ~ x * y - β * z]
75-
75+
7676
@named lorenz1 = System(eqs, t)
7777
@named lorenz2 = System(eqs, t)
78-
78+
7979
@parameters γ
8080
@variables a(t) α(t)
8181
connections = [0 ~ lorenz1.x + lorenz2.y + a * γ,
8282
α ~ 2lorenz1.x + a * γ]
8383
@mtkcompile sys = System(connections, t, [a, α], [γ], systems = [lorenz1, lorenz2])
84-
84+
8585
u0 = [lorenz1.x => 1.0,
8686
lorenz1.y => 0.0,
8787
lorenz1.z => 0.0,
8888
lorenz2.x => 0.0,
8989
lorenz2.y => 1.0,
9090
lorenz2.z => 0.0]
91-
91+
9292
p = [lorenz1.σ => 10.0,
9393
lorenz1.ρ => 28.0,
9494
lorenz1.β => 8 / 3,
9595
lorenz2.σ => 10.0,
9696
lorenz2.ρ => 28.0,
9797
lorenz2.β => 8 / 3,
9898
γ => 2.0]
99-
99+
100100
tspan = (0.0, 100.0)
101101
prob = ODEProblem(sys, [u0; p], tspan)
102102
sol = solve(prob, Rodas4())
103-
103+
104104
@test_throws ArgumentError sol[x]
105-
@test in(sol[lorenz1.x], [getindex.(sol.u, i) for i in 1:length(unknowns(sol.prob.f.sys))])
105+
@test in(sol[lorenz1.x], [getindex.(sol.u, i)
106+
for i in 1:length(unknowns(sol.prob.f.sys))])
106107
@test_throws KeyError sol[:x]
107-
108+
108109
### Non-symbolic indexing tests
109110
@test sol[:, 1] isa AbstractVector
110111
@test sol[:, 1:2] isa AbstractDiffEqArray
111112
@test sol[:, [1, 2]] isa AbstractDiffEqArray
112-
113+
113114
sol1 = sol(0.0:1.0:10.0)
114115
@test sol1.u isa Vector
115116
@test first(sol1.u) isa Vector
116117
@test length(sol1.u) == 11
117118
@test length(sol1.t) == 11
118-
119+
119120
sol2 = sol(0.1)
120121
@test sol2 isa Vector
121122
@test length(sol2) == length(unknowns(sys))
122123
@test first(sol2) isa Real
123-
124+
124125
sol3 = sol(0.0:1.0:10.0, idxs = [lorenz1.x, lorenz2.x])
125-
126+
126127
sol7 = sol(0.0:1.0:10.0, idxs = [2, 1])
127128
@test sol7.u isa Vector
128129
@test first(sol7.u) isa Vector
129130
@test length(sol7.u) == 11
130131
@test length(sol7.t) == 11
131132
@test collect(sol7[t]) sol3.t
132133
@test collect(sol7[t, 1:5]) sol3.t[1:5]
133-
134+
134135
sol8 = sol(0.1, idxs = [2, 1])
135136
@test sol8 isa Vector
136137
@test length(sol8) == 2
137138
@test first(sol8) isa Real
138-
139+
139140
sol9 = sol(0.0:1.0:10.0, idxs = 2)
140141
@test sol9.u isa Vector
141142
@test first(sol9.u) isa Real
142143
@test length(sol9.u) == 11
143144
@test length(sol9.t) == 11
144145
@test collect(sol9[t]) sol3.t
145146
@test collect(sol9[t, 1:5]) sol3.t[1:5]
146-
147+
147148
sol10 = sol(0.1, idxs = 2)
148149
@test sol10 isa Real
149150
end
@@ -194,7 +195,9 @@ end
194195

195196
@mtkcompile sys = System([D(x) ~ x + p * y, 1 ~ sin(y) + cos(x)], t)
196197
xidx = variable_index(sys, x)
197-
prob = DAEProblem(sys, [D(x) => x + p * y, D(y) => 1 / sqrt(1 - (1 - cos(x))^2), x => 1.0, y => asin(1 - cos(x)), p => 2.0],
198+
prob = DAEProblem(sys,
199+
[D(x) => x + p * y, D(y) => 1 / sqrt(1 - (1 - cos(x))^2),
200+
x => 1.0, y => asin(1 - cos(x)), p => 2.0],
198201
(0.0, 1.0); build_initializeprob = false)
199202
dae_sol = solve(prob, DFBDF(); save_idxs = [x])
200203

@@ -225,10 +228,11 @@ end
225228
@testset "ODE with callbacks" begin
226229
@variables x(t) y(t)
227230
@parameters p q(t) r(t) s(t) u(t)
228-
evs = [
229-
ModelingToolkit.SymbolicDiscreteCallback(0.1, [q ~ Pre(q) + 1, s ~ Pre(s) - 1]; discrete_parameters = [q, s], iv = t)
230-
ModelingToolkit.SymbolicDiscreteCallback(0.1, [r ~ 2Pre(r), u ~ Pre(u) / 2]; discrete_parameters = [r, u], iv = t)
231-
]
231+
evs = [ModelingToolkit.SymbolicDiscreteCallback(
232+
0.1, [q ~ Pre(q) + 1, s ~ Pre(s) - 1];
233+
discrete_parameters = [q, s], iv = t)
234+
ModelingToolkit.SymbolicDiscreteCallback(0.1, [r ~ 2Pre(r), u ~ Pre(u) / 2];
235+
discrete_parameters = [r, u], iv = t)]
232236
@mtkcompile sys = System([D(x) ~ x + p * y, D(y) ~ 2p + x], t, [x, y],
233237
[p, q, r, s, u], discrete_events = evs)
234238
@test length(unknowns(sys)) == 2
@@ -243,7 +247,9 @@ end
243247
sidx = parameter_index(sys, s)
244248
uidx = parameter_index(sys, u)
245249

246-
prob = ODEProblem(sys, [x => 1.0, y => 1.0, p => 0.5, q => 0.0, r => 1.0, s => 10.0, u => 4096.0], (0.0, 5.0))
250+
prob = ODEProblem(
251+
sys, [x => 1.0, y => 1.0, p => 0.5, q => 0.0, r => 1.0, s => 10.0, u => 4096.0],
252+
(0.0, 5.0))
247253

248254
@test SciMLBase.SavedSubsystem(sys, prob.p, [x, y, q, r, s, u]) === nothing
249255

@@ -268,13 +274,16 @@ end
268274
@testset "SavedSubsystemWithFallback" begin
269275
@variables x(t) y(t)
270276
@parameters p q(t) r(t) s(t) u(t)
271-
evs = [
272-
ModelingToolkit.SymbolicDiscreteCallback(0.1, [q ~ Pre(q) + 1, s ~ Pre(s) - 1]; discrete_parameters = [q, s], iv = t)
273-
ModelingToolkit.SymbolicDiscreteCallback(0.1, [r ~ 2Pre(r), u ~ Pre(u) / 2]; discrete_parameters = [r, u], iv = t)
274-
]
277+
evs = [ModelingToolkit.SymbolicDiscreteCallback(
278+
0.1, [q ~ Pre(q) + 1, s ~ Pre(s) - 1];
279+
discrete_parameters = [q, s], iv = t)
280+
ModelingToolkit.SymbolicDiscreteCallback(0.1, [r ~ 2Pre(r), u ~ Pre(u) / 2];
281+
discrete_parameters = [r, u], iv = t)]
275282
@mtkcompile sys = System([D(x) ~ x + p * y, D(y) ~ 2p + x^2], t, [x, y],
276283
[p, q, r, s, u], discrete_events = evs)
277-
prob = ODEProblem(sys, [x => 1.0, y => 1.0, p => 0.5, q => 0.0, r => 1.0, s => 10.0, u => 4096.0], (0.0, 5.0))
284+
prob = ODEProblem(
285+
sys, [x => 1.0, y => 1.0, p => 0.5, q => 0.0, r => 1.0, s => 10.0, u => 4096.0],
286+
(0.0, 5.0))
278287
ss = SciMLBase.SavedSubsystem(sys, prob.p, [x, q, s, r])
279288
@test SciMLBase.get_saved_state_idxs(ss) == [variable_index(sys, x)]
280289
sswf = SciMLBase.SavedSubsystemWithFallback(ss, sys)
@@ -314,13 +323,16 @@ end
314323
@testset "get_save_idxs_and_saved_subsystem" begin
315324
@variables x(t) y(t)
316325
@parameters p q(t) r(t) s(t) u(t)
317-
evs = [
318-
ModelingToolkit.SymbolicDiscreteCallback(0.1, [q ~ Pre(q) + 1, s ~ Pre(s) - 1]; discrete_parameters = [q, s], iv = t)
319-
ModelingToolkit.SymbolicDiscreteCallback(0.1, [r ~ 2Pre(r), u ~ Pre(u) / 2]; discrete_parameters = [r, u], iv = t)
320-
]
326+
evs = [ModelingToolkit.SymbolicDiscreteCallback(
327+
0.1, [q ~ Pre(q) + 1, s ~ Pre(s) - 1];
328+
discrete_parameters = [q, s], iv = t)
329+
ModelingToolkit.SymbolicDiscreteCallback(0.1, [r ~ 2Pre(r), u ~ Pre(u) / 2];
330+
discrete_parameters = [r, u], iv = t)]
321331
@mtkcompile sys = System([D(x) ~ x + p * y, D(y) ~ 2p + x^2], t, [x, y],
322332
[p, q, r, s, u], discrete_events = evs)
323-
prob = ODEProblem(sys, [x => 1.0, y => 1.0, p => 0.5, q => 0.0, r => 1.0, s => 10.0, u => 4096.0], (0.0, 5.0))
333+
prob = ODEProblem(
334+
sys, [x => 1.0, y => 1.0, p => 0.5, q => 0.0, r => 1.0, s => 10.0, u => 4096.0],
335+
(0.0, 5.0))
324336

325337
_idxs, _ss = @inferred SciMLBase.get_save_idxs_and_saved_subsystem(prob, nothing)
326338
@test _idxs === _ss === nothing

0 commit comments

Comments
 (0)