Skip to content

Commit 4a9a4e2

Browse files
fix test setup
1 parent 61f776d commit 4a9a4e2

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/systems/nonlinear/nonlinear_system.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ function _find_params(O, vs)
6262
return ps
6363
end
6464

65-
66-
independent_variables(sys::NonlinearSystem) = Set{Variable}()
67-
dependent_variables(sys::NonlinearSystem) = Set{Expression}(sys.vs)
68-
parameters(sys::NonlinearSystem) = Set{Variable}(sys.ps)
65+
states(sys::NonlinearSystem) = sys.vs
66+
parameters(sys::NonlinearSystem) = sys.ps
6967

7068

7169
function calculate_jacobian(sys::NonlinearSystem)

test/odesystem.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ end
2424
_clean(x::Variable) = x
2525
function test_diffeq_inference(name, sys, iv, dvs, ps)
2626
@testset "ODESystem construction: $name" begin
27-
@test independent_variables(sys) == Set([_clean(iv)])
28-
@test dependent_variables(sys) == Set(_clean.(dvs))
29-
@test parameters(sys) == Set(_clean.(ps))
27+
@test independent_variable(sys) == _clean(iv)
28+
@test Set(states(sys)) == Set(_clean.(dvs))
29+
@test Set(parameters(sys)) == Set(_clean.(ps))
3030
end
3131
end
3232
function test_nlsys_inference(name, sys, vs, ps)
3333
@testset "NonlinearSystem construction: $name" begin
34-
@test dependent_variables(sys) == Set(vs)
35-
@test parameters(sys) == Set(_clean.(ps))
34+
@test Set(states(sys)) == Set(vs)
35+
@test Set(parameters(sys)) == Set(_clean.(ps))
3636
end
3737
end
3838

39-
test_diffeq_inference("standard", de, t, (x, y, z), (σ, ρ, β))
39+
test_diffeq_inference("standard", de, t, [x, y, z], [ρ, σ, β])
4040
generate_function(de, [x,y,z], [σ,ρ,β])
4141
jac_expr = generate_jacobian(de)
4242
jac = calculate_jacobian(de)

0 commit comments

Comments
 (0)