Skip to content

Commit b2c79ec

Browse files
committed
Fix bugs in tests, ensure that constant test is run & remove leftover debugging statements.
1 parent 5324156 commit b2c79ec

File tree

5 files changed

+3
-5
lines changed

5 files changed

+3
-5
lines changed

src/structural_transformation/codegen.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ function gen_nlsolve!(is_not_prepended_assignment, eqs, vars, u0map::AbstractDic
188188
fname = gensym("fun")
189189
# f is the function to find roots on
190190
funex = isscalar ? rhss[1] : MakeArray(rhss, SVector)
191-
@show funex
192191
pre = get_preprocess_constants(funex)
193192
f = Func([DestructuredArgs(vars, inbounds = !checkbounds)
194193
DestructuredArgs(params, inbounds = !checkbounds)],

src/systems/optimization/optimizationsystem.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ function OptimizationProblemExpr{iip}(sys::OptimizationSystem, u0,
390390
[Symbol(_p) => p[i] for (i, _p) in enumerate(ps)]...,
391391
]
392392
rep_pars_vals!(obj_expr, pairs_arr)
393-
@show sys.constraints
394393
if length(sys.constraints) > 0
395394
@named cons_sys = NonlinearSystem(sys.constraints, dvs, ps)
396395
cons = generate_function(cons_sys, checkbounds = checkbounds,

test/constants.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ eqs = [D(x) ~ a]
1212
prob = ODEProblem(sys, [0], [0.0, 1.0], [])
1313
sol = solve(prob, Tsit5())
1414

15-
newsys = eliminate_constants(sys)
15+
newsys = MT.eliminate_constants(sys)
1616
@test isequal(equations(newsys), [D(x) ~ 1])
1717

1818
# Test structural_simplify substitutions & observed values

test/funcaffect.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ i8 = findfirst(==(8.0), sol[:t])
122122
ctx = [0]
123123
function affect4!(integ, u, p, ctx)
124124
ctx[1] += 1
125-
@test u.resistor₊v == h
125+
@test u.resistor₊v == 1
126126
end
127127
s1 = compose(ODESystem(Equation[], t, [], [], name = :s1,
128128
discrete_events = 1.0 => (affect4!, [resistor.v], [], ctx)),

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ println("Last test requires gcc available in the path!")
4646
@safetestset "Modelingtoolkitize Test" begin include("modelingtoolkitize.jl") end
4747
@safetestset "OptimizationSystem Test" begin include("optimizationsystem.jl") end
4848
@safetestset "FuncAffect Test" begin include("funcaffect.jl") end
49-
49+
@safetestset "Constants Test" begin include("constants.jl") end
5050
# Reference tests go Last
5151
@safetestset "Latexify recipes Test" begin include("latexify.jl") end

0 commit comments

Comments
 (0)