File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Expand file tree Collapse file tree 3 files changed +33
-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 2828 @test_throws Exception Catalyst. iscomplexbalanced (rn, k)
2929end
3030
31+ # Test that incomplete rate maps error.
32+ let
33+ rn = @reaction_network begin
34+ (k1, k2), C1 <--> C2
35+ (k3, k4), C2 <--> C3
36+ (k5, k6), C3 <--> C1
37+ end
38+
39+ incorrect_params = Dict (:k1 => 0.5 )
40+ @test_throws ErrorException Catalyst. iscomplexbalanced (rn, incorrect_params)
41+ end
42+
3143# Tests rate matrix computation for various input types.
3244let
3345 # Declares network and its known rate matrix.
6173 Catalyst. ratematrix (rn, rates_vec) == rate_mat
6274 Catalyst. ratematrix (rn, rates_tup) == rate_mat
6375 Catalyst. ratematrix (rn, rates_dict) == rate_mat
76+
77+ # Tests that throws error in rate matrix.
78+ incorrect_param_dict = Dict (:k1 => 1.0 )
79+
80+ @test_throws ErrorException Catalyst. ratematrix (rn, 123 )
81+ @test_throws ErrorException Catalyst. ratematrix (rn, incorrect_param_dict)
82+
6483 @test_throws Exception Catalyst. iscomplexbalanced (rn, rates_invalid)
6584end
6685
92111 @test Catalyst. robustspecies (EnvZ_OmpR) == [6 ]
93112end
94113
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
95124
96125# ## Complex balance and reversibility tests ###
97126
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