Skip to content

Commit 9ac6878

Browse files
committed
Fix tests
1 parent 53c2803 commit 9ac6878

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/structural_transformation/symbolics_tearing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ end
3737
function full_equations(sys::AbstractSystem; simplify=false)
3838
empty_substitutions(sys) && return equations(sys)
3939
substitutions = get_substitutions(sys)
40-
substitutions.subed_eqs === nothing && return substitutions.subed_eqs
40+
substitutions.subed_eqs === nothing || return substitutions.subed_eqs
4141
@unpack subs = substitutions
4242
solved = Dict(eq.lhs => eq.rhs for eq in subs)
4343
neweqs = map(equations(sys)) do eq

src/structural_transformation/utils.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ end
236236

237237
function torn_system_jacobian_sparsity(sys)
238238
has_structure(sys) || return nothing
239+
get_structure(sys) isa SystemStructure || return nothing
239240
s = structure(sys)
240241
@unpack fullvars, graph = s
241242

test/odesystem.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ for p in [prob1, prob14]
220220
end
221221
prob2 = ODEProblem(sys,u0,tspan,p,jac=true)
222222
prob3 = ODEProblem(sys,u0,tspan,p,jac=true,sparse=true)
223+
@test prob3.f.jac_prototype isa SparseMatrixCSC
224+
prob3 = ODEProblem(sys,u0,tspan,p,jac=true,sparsity=true)
223225
@test prob3.f.sparsity isa SparseMatrixCSC
224226
@test_throws ArgumentError ODEProblem(sys,zeros(5),tspan,p)
225227
for (prob, atol) in [(prob1, 1e-12), (prob2, 1e-12), (prob3, 1e-12)]

0 commit comments

Comments
 (0)