File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 180
180
rates = Dict (zip (parameters (rn4), k))
181
181
@test Catalyst. iscomplexbalanced (rn4, rates) == true
182
182
end
183
+
184
+ let
185
+ rn = @reaction_network begin
186
+ (k1, k2), C1 <--> C2
187
+ (k3, k4), C2 <--> C3
188
+ (k5, k6), C3 <--> C1
189
+ end
190
+
191
+ incorrect_params = Dict (:k1 => 0.5 )
192
+ @test_throws ErrorException Catalyst. iscomplexbalanced (rn, incorrect_params)
193
+ end
183
194
184
195
# ## Tests Reversibility ###
185
196
708
719
Catalyst. ratematrix (rn, rates_vec) == rate_mat
709
720
Catalyst. ratematrix (rn, rates_tup) == rate_mat
710
721
Catalyst. ratematrix (rn, rates_dict) == rate_mat
722
+
723
+ # Tests that throws error in rate matrix.
724
+ incorrect_param_dict = Dict (:k1 => 1.0 )
725
+
726
+ @test_throws ErrorException Catalyst. ratematrix (rn, 123 )
727
+ @test_throws ErrorException Catalyst. ratematrix (rn, incorrect_param_dict)
728
+
711
729
@test_throws Exception Catalyst. iscomplexbalanced (rn, rates_invalid)
712
730
end
713
731
739
757
@test Catalyst. robustspecies (EnvZ_OmpR) == [6 ]
740
758
end
741
759
760
+ let
761
+ # Define a reaction network with bi-directional reactions
762
+ non_deficient_network = @reaction_network begin
763
+ (k1, k2), A <--> B
764
+ (k3, k4), B <--> C
765
+ end
766
+
767
+ # Test: Check that the error is raised for networks with deficiency != 1
768
+ @test_throws ErrorException Catalyst. robustspecies (non_deficient_network)
769
+ end
770
+
742
771
743
772
# ## Complex and detailed balance tests
744
773
Original file line number Diff line number Diff line change 107
107
let
108
108
@named rs2 = ReactionSystem (rxs, t)
109
109
@test Catalyst. isequivalent (rs, rs2)
110
+
111
+ # Test with a type mismatch
112
+ @test Catalyst. isequivalent (rs, " Not a ReactionSystem" ) == false
110
113
end
111
114
112
115
# Defaults test.
You can’t perform that action at this time.
0 commit comments