65
65
@test (@test_logs (:warn , ) match_mode= :any validate (bad_rs)) == false
66
66
end
67
67
68
-
69
68
# Checks that units work in the DSL.
70
69
begin
71
70
# Creates the model, while designating matching units.
@@ -147,3 +146,49 @@ begin
147
146
end
148
147
end
149
148
149
+ # Checks that units works for various non-trivial systems.
150
+ let
151
+ # Parametric rates (no units).
152
+ @test_broken false # This yields a warning (and it shouldn't).
153
+ rn = @reaction_network begin
154
+ k1, 2 X1 --> Z1
155
+ k2, n2* X2 --> m2* Z2
156
+ k3, n3* X3 + m3* Y3--> Z3
157
+ end
158
+
159
+ # Parametric rates with units is not possible, since the unit depends on the parameter values.
160
+
161
+ # Non-constant rates (no units).
162
+ @test_nowarn rn = @reaction_network begin
163
+ k1* X1, 2 X1 --> Z1
164
+ mm (X2, v2, K2), X2 --> Z2
165
+ hill (X3, v3, K3, n3), X3 + Y3--> Z3
166
+ end
167
+
168
+ # Non-constant rates (units).
169
+ @test_broken false # The below expression generates an error on compile. Really no idea why, have
170
+ # managed to make a really small example of it, but not figured it out yet.
171
+ # rn = @reaction_network begin
172
+ # @ivs t [unit=u"s"]
173
+ # @species begin
174
+ # X1(t), [unit=u"m"]
175
+ # Z1(t), [unit=u"m"]
176
+ # X2(t), [unit=u"m"]
177
+ # Z2(t), [unit=u"m"]
178
+ # X3(t), [unit=u"m"]
179
+ # Y3(t), [unit=u"m"]
180
+ # Z3(t), [unit=u"m"]
181
+ # end
182
+ # @parameters begin
183
+ # k1, [unit=u"m^(-4)/s"]
184
+ # v2, [unit=u"m^(-4)/s"]
185
+ # K2, [unit=u"m"]
186
+ # v3, [unit=u"m^(-3)/s"]
187
+ # K3, [unit=u"m"]
188
+ # n3
189
+ # end
190
+ # k1*X1, 2X1 --> Z1
191
+ # mm(X2, v, K), 3X2 --> Z2
192
+ # hill(X3, v3, K3, n3), X3 + Y3--> Z3
193
+ # end
194
+ end
0 commit comments