|
27 | 27 | @test_throws Exception Catalyst.iscomplexbalanced(rn, k)
|
28 | 28 | end
|
29 | 29 |
|
| 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 | + |
30 | 42 | # Tests rate matrix computation for various input types.
|
31 | 43 | let
|
32 | 44 | # Declares network and its known rate matrix.
|
|
56 | 68 | rates_invalid = reshape(rate_vals, 1, 8)
|
57 | 69 |
|
58 | 70 | # Tests that all input types generates the correct rate matrix.
|
| 71 | +<<<<<<< HEAD |
59 | 72 | @test Catalyst.adjacencymat(rn, rates_vec) == rate_mat
|
60 | 73 | @test Catalyst.adjacencymat(rn, rates_tup) == rate_mat
|
61 | 74 | @test Catalyst.adjacencymat(rn, rates_dict) == rate_mat
|
62 | 75 | @test_throws Exception Catalyst.adjacencymat(rn, rate_vals)
|
| 76 | +======= |
| 77 | + Catalyst.ratematrix(rn, rate_vals) == rate_mat |
| 78 | + Catalyst.ratematrix(rn, rates_vec) == rate_mat |
| 79 | + Catalyst.ratematrix(rn, rates_tup) == rate_mat |
| 80 | + Catalyst.ratematrix(rn, rates_dict) == rate_mat |
| 81 | + |
| 82 | + # Tests that throws error in rate matrix. |
| 83 | + incorrect_param_dict = Dict(:k1 => 1.0) |
| 84 | + |
| 85 | + @test_throws ErrorException Catalyst.ratematrix(rn, 123) |
| 86 | + @test_throws ErrorException Catalyst.ratematrix(rn, incorrect_param_dict) |
| 87 | + |
| 88 | +>>>>>>> a309a9e81f964703653d00de2918e77c40f6ba6a |
63 | 89 | @test_throws Exception Catalyst.iscomplexbalanced(rn, rates_invalid)
|
64 | 90 |
|
65 | 91 | # Test sparse matrix
|
|
94 | 120 | @test Catalyst.robustspecies(EnvZ_OmpR) == [6]
|
95 | 121 | end
|
96 | 122 |
|
| 123 | +let |
| 124 | + # Define a reaction network with bi-directional reactions |
| 125 | + non_deficient_network = @reaction_network begin |
| 126 | + (k1, k2), A <--> B |
| 127 | + (k3, k4), B <--> C |
| 128 | + end |
| 129 | + |
| 130 | + # Test: Check that the error is raised for networks with deficiency != 1 |
| 131 | + @test_throws ErrorException Catalyst.robustspecies(non_deficient_network) |
| 132 | +end |
97 | 133 |
|
98 | 134 | ### Complex balance and reversibility tests ###
|
99 | 135 |
|
|
0 commit comments