Skip to content

Commit d6f1588

Browse files
committed
fix
1 parent 74277db commit d6f1588

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

test/upstream/mtk_structure_indexing.jl

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ end
6464

6565
# Tests problem indexing and updating.
6666
let
67+
@test_broken false # A few cases fails for JumpProblem: https://github.com/SciML/ModelingToolkit.jl/issues/2838
6768
@test_broken false # A few cases fails for SteadyStateProblem: https://github.com/SciML/SciMLBase.jl/issues/660
6869
@test_broken false # Most cases broken for Ensemble problems: https://github.com/SciML/SciMLBase.jl/issues/661
69-
for prob in deepcopy(problems[1:end-1])
70+
for prob in deepcopy([oprob, sprob, dprob, nprob])
7071
# Get u values (including observables).
7172
@test prob[X] == prob[model.X] == prob[:X] == 4
7273
@test prob[XY] == prob[model.XY] == prob[:XY] == 9
7374
@test prob[[XY,Y]] == prob[[model.XY,model.Y]] == prob[[:XY,:Y]] == [9, 5]
74-
@test_broken prob[(XY,Y)] == prob[(model.XY,model.Y)] == prob[(:XY,:Y)] == (9, 5)
75+
@test prob[(XY,Y)] == prob[(model.XY,model.Y)] == prob[(:XY,:Y)] == (9, 5)
7576
@test getu(prob, X)(prob) == getu(prob, model.X)(prob) == getu(prob, :X)(prob) == 4
7677
@test getu(prob, XY)(prob) == getu(prob, model.XY)(prob) == getu(prob, :XY)(prob) == 9
7778
@test getu(prob, [XY,Y])(prob) == getu(prob, [model.XY,model.Y])(prob) == getu(prob, [:XY,:Y])(prob) == [9, 5]
@@ -117,8 +118,10 @@ end
117118

118119
# Test remake function.
119120
let
121+
@test_broken false # Cannot check result for JumpProblem: https://github.com/SciML/ModelingToolkit.jl/issues/2838
122+
@test_broken false # Cannot deepcopy SteadyStateProblem :https://github.com/SciML/ModelingToolkit.jl/issues/2837
120123
@test_broken false # Currently cannot be run for Ensemble problems: https://github.com/SciML/SciMLBase.jl/issues/661 (as indexing cannot be used to check values).
121-
for prob in deepcopy(problems)
124+
for prob in deepcopy([oprob, sprob, dprob, nprob])
122125
# Remake for all u0s.
123126
rp = remake(prob; u0 = [X => 1, Y => 2])
124127
@test rp[[X, Y]] == [1, 2]
@@ -155,10 +158,8 @@ end
155158

156159
# Test integrator indexing.
157160
let
158-
@test_broken false # NOTE: Multiple problems for `nint` (https://github.com/SciML/SciMLBase.jl/issues/662).
159-
@test_broken false # NOTE: Multiple problems for `jint` (https://github.com/SciML/SciMLBase.jl/issues/654).
160161
@test_broken false # NOTE: Cannot even create a `ssint` (https://github.com/SciML/SciMLBase.jl/issues/660).
161-
for int in deepcopy([oint, sint])
162+
for int in deepcopy([oint, sint, jint, nint])
162163
# Get u values.
163164
@test int[X] == int[model.X] == int[:X] == 4
164165
@test int[XY] == int[model.XY] == int[:XY] == 9
@@ -258,13 +259,12 @@ let
258259

259260
# Handles nonlinear and steady state solutions differently.
260261
let
261-
@test_broken false # Currently a problem for nonlinear solutions and steady state solutions (https://github.com/SciML/SciMLBase.jl/issues/720).
262-
for sol in deepcopy([])
262+
for sol in deepcopy([nsol, sssol])
263263
# Get u values.
264264
@test sol[X] == sol[model.X] == sol[:X]
265265
@test sol[XY] == sol[model.XY][1] == sol[:XY]
266266
@test sol[[XY,Y]] == sol[[model.XY,model.Y]] == sol[[:XY,:Y]]
267-
@test_broken sol[(XY,Y)] == sol[(model.XY,model.Y)] == sol[(:XY,:Y)]
267+
@test sol[(XY,Y)] == sol[(model.XY,model.Y)] == sol[(:XY,:Y)]
268268
@test getu(sol, X)(sol) == getu(sol, model.X)(sol)[1] == getu(sol, :X)(sol)
269269
@test getu(sol, XY)(sol) == getu(sol, model.XY)(sol)[1] == getu(sol, :XY)(sol)
270270
@test getu(sol, [XY,Y])(sol) == getu(sol, [model.XY,model.Y])(sol) == getu(sol, [:XY,:Y])(sol)
@@ -283,8 +283,7 @@ end
283283

284284
# Tests plotting.
285285
let
286-
@test_broken false # Currently broken for `ssol` (https://github.com/SciML/SciMLBase.jl/issues/580)
287-
for sol in deepcopy([osol, jsol])
286+
for sol in deepcopy([osol, jsol, ssol])
288287
# Single variable.
289288
@test length(plot(sol; idxs = X).series_list) == 1
290289
@test length(plot(sol; idxs = XY).series_list) == 1
@@ -389,4 +388,3 @@ let
389388
reset_aggregated_jumps!(jint)
390389
@test jint.cb.condition.ma_jumps.scaled_rates[1] == 6.0
391390
end
392-

0 commit comments

Comments
 (0)