@@ -6,11 +6,14 @@ using OrdinaryDiffEq, Sundials
66using DiffEqBase, SparseArrays
77using StaticArrays
88using Test
9- using SymbolicUtils: issym
9+ using SymbolicUtils. Code
10+ using SymbolicUtils: Sym, issym
1011using ForwardDiff
1112using ModelingToolkit: value
1213using ModelingToolkit: t_nounits as t, D_nounits as D
14+ using Symbolics
1315using Symbolics: unwrap
16+ using DiffEqBase: isinplace
1417
1518# Define some variables
1619@parameters σ ρ β
@@ -505,13 +508,6 @@ sys = complete(sys)
505508@test_throws Any ODEFunction (sys)
506509
507510@testset " Preface tests" begin
508- using OrdinaryDiffEq
509- using Symbolics
510- using DiffEqBase: isinplace
511- using ModelingToolkit
512- using SymbolicUtils. Code
513- using SymbolicUtils: Sym
514-
515511 c = [0 ]
516512 function f (c, du:: AbstractVector{Float64} , u:: AbstractVector{Float64} , p, t:: Float64 )
517513 c .= [c[1 ] + 1 ]
@@ -554,7 +550,9 @@ sys = complete(sys)
554550
555551 @named sys = System (eqs, t, us, ps; defaults = defs, preface = preface)
556552 sys = complete (sys)
557- prob = ODEProblem (sys, [], (0.0 , 1.0 ))
553+ # don't build initializeprob because it will use preface in other functions and
554+ # affect `c`
555+ prob = ODEProblem (sys, [], (0.0 , 1.0 ); build_initializeprob = false )
558556 sol = solve (prob, Euler (); dt = 0.1 )
559557
560558 @test c[1 ] == length (sol)
0 commit comments