diff --git a/docs/pages.jl b/docs/pages.jl index e17fbbe7b4..bbc977797c 100644 --- a/docs/pages.jl +++ b/docs/pages.jl @@ -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" ], diff --git a/test/network_analysis/crn_theory.jl b/test/network_analysis/crn_theory.jl index deb53b21b5..c5f824fa62 100644 --- a/test/network_analysis/crn_theory.jl +++ b/test/network_analysis/crn_theory.jl @@ -28,6 +28,18 @@ let @test_throws Exception Catalyst.iscomplexbalanced(rn, k) end +# Test that incomplete rate maps error. +let + rn = @reaction_network begin + (k1, k2), C1 <--> C2 + (k3, k4), C2 <--> C3 + (k5, k6), C3 <--> C1 + end + + incorrect_params = Dict(:k1 => 0.5) + @test_throws ErrorException Catalyst.iscomplexbalanced(rn, incorrect_params) +end + # Tests rate matrix computation for various input types. let # Declares network and its known rate matrix. @@ -61,6 +73,13 @@ let Catalyst.ratematrix(rn, rates_vec) == rate_mat Catalyst.ratematrix(rn, rates_tup) == rate_mat Catalyst.ratematrix(rn, rates_dict) == rate_mat + + # Tests that throws error in rate matrix. + incorrect_param_dict = Dict(:k1 => 1.0) + + @test_throws ErrorException Catalyst.ratematrix(rn, 123) + @test_throws ErrorException Catalyst.ratematrix(rn, incorrect_param_dict) + @test_throws Exception Catalyst.iscomplexbalanced(rn, rates_invalid) end @@ -92,6 +111,16 @@ let @test Catalyst.robustspecies(EnvZ_OmpR) == [6] end +let + # Define a reaction network with bi-directional reactions + non_deficient_network = @reaction_network begin + (k1, k2), A <--> B + (k3, k4), B <--> C + end + + # Test: Check that the error is raised for networks with deficiency != 1 + @test_throws ErrorException Catalyst.robustspecies(non_deficient_network) +end ### Complex balance and reversibility tests ### diff --git a/test/reactionsystem_core/reactionsystem.jl b/test/reactionsystem_core/reactionsystem.jl index 505781305a..0045b04c3c 100644 --- a/test/reactionsystem_core/reactionsystem.jl +++ b/test/reactionsystem_core/reactionsystem.jl @@ -107,6 +107,9 @@ end let @named rs2 = ReactionSystem(rxs, t) @test Catalyst.isequivalent(rs, rs2) + + # Test with a type mismatch + @test Catalyst.isequivalent(rs, "Not a ReactionSystem") == false end # Defaults test.