File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ pages = Any[
4040 " Steady state analysis" => Any[
4141 " steady_state_functionality/homotopy_continuation.md" ,
4242 " steady_state_functionality/nonlinear_solve.md" ,
43- # "steady_state_functionality/steady_state_stability_computation.md",
43+ # "steady_state_functionality/steady_state_stability_computation.md",
4444 " steady_state_functionality/bifurcation_diagrams.md" ,
4545 " steady_state_functionality/dynamical_systems.md"
4646 ],
Original file line number Diff line number Diff line change 2727 @test_throws Exception Catalyst. iscomplexbalanced (rn, k)
2828end
2929
30+ # Test that incomplete rate maps error.
31+ let
32+ rn = @reaction_network begin
33+ (k1, k2), C1 <--> C2
34+ (k3, k4), C2 <--> C3
35+ (k5, k6), C3 <--> C1
36+ end
37+
38+ incorrect_params = Dict (:k1 => 0.5 )
39+ @test_throws ErrorException Catalyst. iscomplexbalanced (rn, incorrect_params)
40+ end
41+
3042# Tests rate matrix computation for various input types.
3143let
3244 # Declares network and its known rate matrix.
6072 @test Catalyst. adjacencymat (rn, rates_tup) == rate_mat
6173 @test Catalyst. adjacencymat (rn, rates_dict) == rate_mat
6274 @test_throws Exception Catalyst. adjacencymat (rn, rate_vals)
75+
76+ incorrect_param_dict = Dict (:k1 => 1.0 )
77+ @test_throws ErrorException Catalyst. ratematrix (rn, 123 )
78+ @test_throws ErrorException Catalyst. ratematrix (rn, incorrect_param_dict)
79+
6380 @test_throws Exception Catalyst. iscomplexbalanced (rn, rates_invalid)
6481
6582 # Test sparse matrix
94111 @test Catalyst. robustspecies (EnvZ_OmpR) == [6 ]
95112end
96113
114+ let
115+ # Define a reaction network with bi-directional reactions
116+ non_deficient_network = @reaction_network begin
117+ (k1, k2), A <--> B
118+ (k3, k4), B <--> C
119+ end
120+
121+ # Test: Check that the error is raised for networks with deficiency != 1
122+ @test_throws ErrorException Catalyst. robustspecies (non_deficient_network)
123+ end
97124
98125# ## Complex balance and reversibility tests ###
99126
Original file line number Diff line number Diff line change 107107let
108108 @named rs2 = ReactionSystem (rxs, t)
109109 @test Catalyst. isequivalent (rs, rs2)
110+
111+ # Test with a type mismatch
112+ @test Catalyst. isequivalent (rs, " Not a ReactionSystem" ) == false
110113end
111114
112115# Defaults test.
You can’t perform that action at this time.
0 commit comments