Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fix #1159

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ JumpProcesses = "9.13.2"
LaTeXStrings = "1.3.0"
Latexify = "0.16.5"
MacroTools = "0.5.5"
ModelingToolkit = "< 9.60"
ModelingToolkit = "< 9.60, =9.60"
NetworkLayout = "0.4.7"
Parameters = "0.12"
Reexport = "0.2, 1.0"
Expand All @@ -67,7 +67,7 @@ RuntimeGeneratedFunctions = "0.5.12"
SciMLBase = "2.57.2"
Setfield = "1"
# StructuralIdentifiability = "0.5.8"
SymbolicUtils = "< 3.8"
SymbolicUtils = "< 3.8.1, = 3.8.1"
Symbolics = "6.22"
Unitful = "1.12.4"
julia = "1.10"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ IncompleteLU = "0.2"
JumpProcesses = "9.13.2"
Latexify = "0.16.5"
LinearSolve = "2.30"
ModelingToolkit = "< 9.60"
ModelingToolkit = "< 9.60, =9.60"
NonlinearSolve = "3.12, 4"
Optim = "1.9"
Optimization = "4"
Expand Down
23 changes: 12 additions & 11 deletions test/network_analysis/conservation_laws.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ let
end

# Tests that `conservationlaws`'s caches something.
let
let
# Creates network with/without cached conservation laws.
rn = @reaction_network rn begin
(k1,k2), X1 <--> X2
end
rn_cached = deepcopy(rn)
conservationlaws(rn_cached)

# Checks that equality is correct (currently equality does not consider network property caching).
@test rn_cached == rn
@test Catalyst.get_networkproperties(rn_cached) != Catalyst.get_networkproperties(rn)
Expand Down Expand Up @@ -175,10 +175,10 @@ end

# Tests simulations for various input types (using X, rn.X, and :X forms).
# Tests that conservation laws can be generated for system with non-default parameter types.
let
let
# Prepares the model.
rn = @reaction_network rn begin
@parameters kB::Int64
@parameters kB::Int64
(kB,kD), X + Y <--> XY
end
sps = species(rn)
Expand Down Expand Up @@ -211,7 +211,7 @@ let
end

# Checks that the conservation law parameter's value can be changed in simulations.
let
let
# Prepares `ODEProblem`s.
rn = @reaction_network begin
(k1,k2), X1 <--> X2
Expand Down Expand Up @@ -309,7 +309,7 @@ end
# Checks that conservation law elimination warnings are generated in the correct cases.
let
# Prepare model.
rn = @reaction_network begin
rn = @reaction_network begin
(k1,k2), X1 <--> X2
end
u0 = [:X1 => 1.0, :X2 => 2.0]
Expand All @@ -325,11 +325,12 @@ let
end

# Checks during problem creation (separate depending on whether they have a time span or not).
@test_broken false # SDEProblems generate anacounted for warnings here. These should be figured out and `warn_initialize_determined = false` removed (https://github.com/SciML/Catalyst.jl/pull/1159).
for XProblem in [ODEProblem, SDEProblem]
@test_nowarn XProblem(rn, u0, tspan, ps)
@test_logs (:warn, r"You are creating a system or problem while eliminating conserved quantities. Please *") XProblem(rn, u0, tspan, ps; remove_conserved = true)
@test_nowarn XProblem(rn, u0, tspan, ps; remove_conserved_warn = false)
@test_nowarn XProblem(rn, u0, tspan, ps; remove_conserved = true, remove_conserved_warn = false)
@test_nowarn XProblem(rn, u0, tspan, ps, warn_initialize_determined = false)
@test_logs (:warn, r"You are creating a system or problem while eliminating conserved quantities. Please *") XProblem(rn, u0, tspan, ps; remove_conserved = true, warn_initialize_determined = false)
@test_nowarn XProblem(rn, u0, tspan, ps; remove_conserved_warn = false, warn_initialize_determined = false)
@test_nowarn XProblem(rn, u0, tspan, ps; remove_conserved = true, remove_conserved_warn = false, warn_initialize_determined = false)
end
for XProblem in [NonlinearProblem, SteadyStateProblem]
@test_nowarn XProblem(rn, u0, ps)
Expand All @@ -340,7 +341,7 @@ let
end

# Conservation law simulations for vectorised species.
let
let
# Prepares the model.
t = default_t()
@species (X(t))[1:2]
Expand Down
3 changes: 2 additions & 1 deletion test/upstream/mtk_problem_inputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ let
end

# Perform jump simulations (singular and ensemble).
let
# Currently broken due to https://github.com/SciML/ModelingToolkit.jl/issues/3297
@test_broken let
# Creates normal and ensemble problems.
base_dprob = DiscreteProblem(model, u0_alts[1], tspan, p_alts[1])
base_jprob = JumpProblem(model, base_dprob, Direct(); rng)
Expand Down
3 changes: 2 additions & 1 deletion test/upstream/mtk_structure_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ end
# Test remake function.
let
@test_broken false # Cannot check result for JumpProblem: https://github.com/SciML/ModelingToolkit.jl/issues/2838
for prob in deepcopy([oprob, sprob, dprob, nprob, ssprob, eoprob, esprob, edprob, enprob, essprob])
@test_broken false # Broken for SDEProblems: https://github.com/SciML/ModelingToolkit.jl/issues/3295, https://github.com/SciML/Catalyst.jl/pull/1159
for prob in deepcopy([oprob, dprob, nprob, ssprob, eoprob, edprob, enprob, essprob])
# Remake for all u0s.
rp = remake(prob; u0 = [X => 1, Y => 2])
@test rp[[X, Y]] == [1, 2]
Expand Down
Loading