Skip to content

Commit

Permalink
TEMP: logging after every test
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Dec 20, 2023
1 parent a57485c commit 999f3da
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/symbolic_indexing_interface_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,72 @@ dx = DiffEqArray([[f(x), f2(x)] for x in t],
parameters = [:p, :q],
independent_variables = [:t])
@test dx[:t] == t
@info "TEST 1"
@test dx[:a] == [f(x) for x in t]
@info "TEST 2"
@test dx[:a, 2] f(t[2])
@info "TEST 3"
@test dx[:b, 3] f2(t[3])
@info "TEST 4"
@test dx[:a, 2:4] [f(x) for x in t[2:4]]
@info "TEST 5"
@test dx[:b, 4:6] [f2(x) for x in t[4:6]]
@info "TEST 6"
@test dx[:b] [f2(x) for x in t]
@info "TEST 7"
@test dx[[:a, :b]] [[f(x), f2(x)] for x in t]
@info "TEST 8"
@test dx[(:a, :b)] == [(f(x), f2(x)) for x in t]
@info "TEST 9"
@test dx[[:a, :b], 3] [f(t[3]), f2(t[3])]
@info "TEST 10"
@test dx[[:a, :b], 4:5] vcat(f.(t[4:5])', f2.(t[4:5])')
@info "TEST 11"
@test getp(dx, [:p, :q])(dx) == [1.0, 2.0]
@info "TEST 12"
@test getp(dx, :p)(dx) == 1.0
@info "TEST 13"
@test getp(dx, :q)(dx) == 2.0
@info "TEST 14"
@test_deprecated dx[:p]
@info "TEST 15"
@test_deprecated dx[[:p, :q]]
@info "TEST 16"
@test dx[:t] == t
@info "TEST 17"

@test symbolic_container(dx) isa SymbolCache
@info "TEST 18"
@test parameter_values(dx) == [1.0, 2.0]
@info "TEST 19"
@test is_variable.((dx,), [:a, :b, :p, :q, :t]) == [true, true, false, false, false]
@info "TEST 20"
@test variable_index.((dx,), [:a, :b, :p, :q, :t]) == [1, 2, nothing, nothing, nothing]
@info "TEST 21"
@test is_parameter.((dx,), [:a, :b, :p, :q, :t]) == [false, false, true, true, false]
@info "TEST 22"
@test parameter_index.((dx,), [:a, :b, :p, :q, :t]) == [nothing, nothing, 1, 2, nothing]
@info "TEST 23"
@test is_independent_variable.((dx,), [:a, :b, :p, :q, :t]) == [false, false, false, false, true]
@info "TEST 24"
@test variable_symbols(dx) == [:a, :b]
@info "TEST 25"
@test parameter_symbols(dx) == [:p, :q]
@info "TEST 26"
@test independent_variable_symbols(dx) == [:t]
@info "TEST 27"
@test is_time_dependent(dx)
@info "TEST 28"
@test constant_structure(dx)
@info "TEST 29"

dx = DiffEqArray([[f(x), f2(x)] for x in t], t; variables = [:a, :b])
@test_throws Exception dx[nothing] # make sure it isn't storing [nothing] as indepsym
@info "TEST 30"

ABC = @SLVector (:a, :b, :c);
A = ABC(1, 2, 3);
B = RecursiveArrayTools.DiffEqArray([A, A], [0.0, 2.0]);
@test getindex(B, :a) == [1, 1]
@info "TEST 31"

0 comments on commit 999f3da

Please sign in to comment.