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
2 changes: 1 addition & 1 deletion 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"
NetworkLayout = "0.4.7"
Parameters = "0.12"
Reexport = "0.2, 1.0"
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"
NonlinearSolve = "3.12, 4"
Optim = "1.9"
Optimization = "4"
Expand Down
2 changes: 1 addition & 1 deletion docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pages = Any[
"Steady state analysis" => Any[
"steady_state_functionality/homotopy_continuation.md",
"steady_state_functionality/nonlinear_solve.md",
"steady_state_functionality/steady_state_stability_computation.md",
#"steady_state_functionality/steady_state_stability_computation.md",
"steady_state_functionality/bifurcation_diagrams.md",
"steady_state_functionality/dynamical_systems.md"
],
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ etc).
- Models can be [coupled with events](@ref constraint_equations_events) that affect the system and its state during simulations.
- By leveraging ModelingToolkit, users have a variety of options for generating optimized system representations to use in solvers. These include construction of [dense or sparse Jacobians](@ref ode_simulation_performance_sparse_jacobian), [multithreading or parallelization of generated derivative functions](@ref ode_simulation_performance_parallelisation), [automatic classification of reactions into optimized jump types for Gillespie type simulations](https://docs.sciml.ai/JumpProcesses/stable/jump_types/#jump_types), [automatic construction of dependency graphs for jump systems](https://docs.sciml.ai/JumpProcesses/stable/jump_types/#Jump-Aggregators-Requiring-Dependency-Graphs), and more.
- [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl) symbolic expressions and Julia `Expr`s can be obtained for all rate laws and functions determining the deterministic and stochastic terms within resulting ODE, SDE, or jump models.
- [Steady states](@ref homotopy_continuation) (and their [stabilities](@ref steady_state_stability)) can be computed for model ODE representations.
- [Steady states](@ref homotopy_continuation) can be computed for model ODE representations.

#### [Features of Catalyst composing with other packages](@id doc_index_features_composed)
- [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl) Can be used to numerically solve generated reaction rate equation ODE models.
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