Skip to content

Commit 1322f56

Browse files
Merge pull request #57 from Gaussia/depricate_default
Depricate default
2 parents 0f17687 + 1df5e22 commit 1322f56

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/reaction_network.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ macro reaction_network(name, scale_noise, ex::Expr, p...)
5757
coordinate(name, MacroTools.striplines(ex), p, scale_noise)
5858
end
5959

60-
#Used to give a warning if someone uses the old macro.
61-
macro reaction_network(ex::Expr)
62-
error("The Reaction Network DSL have been deprecated in favor for a new one. With only slight modification old code can be made to work with the new DSL. In addition the new one provides lots of additional functionality. Please view the documentation for more information.")
60+
#If no type name is given, creates a network with a default name.
61+
macro reaction_network(ex::Expr, p...)
62+
coordinate(:reaction_network, MacroTools.striplines(ex), p, :no___noise___scaling)
6363
end
6464

6565
#Declare various arrow types symbols used for the empty set (also 0).

test/make_model_test.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using DiffEqBiological, Test
1+
using DiffEqBiological, Test, DiffEqBase
22

33
network1 = @reaction_network rn begin
44
2.0, X + Y --> XY
@@ -78,3 +78,17 @@ for i = 1:100
7878
@test network4.jumps[2].rate(u,p,t) == network5.jumps[2].rate(u,p,t)
7979
@test network4.jumps[3].rate(u,p,t) == network5.jumps[3].rate(u,p,t)
8080
end
81+
82+
network6 = @reaction_network begin
83+
p2, X + Y --> XY
84+
p1, XY X + Y
85+
(1,X), Z Z1 + Z2
86+
end p1 p2
87+
88+
@test length(network6.f_func) == 6
89+
@test length(network6.g_func) == 24
90+
@test size(network6.p_matrix) == (6,4)
91+
@test length(network6.params) == 2
92+
@test length(network6.syms) == 6
93+
@test typeof(network6) <: DiffEqBase.AbstractReactionNetwork
94+
@test typeof(network6) == reaction_network

0 commit comments

Comments
 (0)