Skip to content

Commit 56c1250

Browse files
Merge pull request #325 from SciML/myb/up
Update to SymbolicUtils v0.10
2 parents 7dd8d47 + a8214ac commit 56c1250

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/Catalyst.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Catalyst
66
using DocStringExtensions
77
using Reexport, ModelingToolkit
88
using ModelingToolkit: Symbolic, value, istree, get_states, get_ps, get_iv, get_systems, get_eqs
9+
const DEFAULT_IV = (@parameters t)[1]
910
@reexport using ModelingToolkit
1011
import MacroTools
1112
import Base: (==), merge!, merge

src/networkapi.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,12 @@ end
236236
######################## functions to extend a network ####################
237237

238238
"""
239-
make_empty_network(; iv=Sym{ModelingToolkit.Parameter{Real}}(:t),
240-
name=gensym(:ReactionSystem))
239+
make_empty_network(; iv=DEFAULT_IV, name=gensym(:ReactionSystem))
241240
242241
Construct an empty [`ReactionSystem`](@ref). `iv` is the independent variable,
243242
usually time, and `name` is the name to give the `ReactionSystem`.
244243
"""
245-
function make_empty_network(; iv=Sym{ModelingToolkit.Parameter{Real}}(:t), name=gensym(:ReactionSystem))
244+
function make_empty_network(; iv=DEFAULT_IV, name=gensym(:ReactionSystem))
246245
ReactionSystem(Reaction[], iv, [], [], Equation[], name, ReactionSystem[])
247246
end
248247

test/api.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Catalyst, DiffEqBase, ModelingToolkit, Test
22

3-
using ModelingToolkit: value, Parameter
3+
using ModelingToolkit: value
44

55
@parameters t k1 k2
66
@variables S I R
@@ -62,9 +62,9 @@ addspecies!(rs, Variable(:S))
6262
@test numspecies(rs) == 3
6363
addspecies!(rs, Variable(:S), disablechecks=true)
6464
@test numspecies(rs) == 4
65-
addparam!(rs, Sym{Parameter{Real}}(:k1))
65+
addparam!(rs, k1)
6666
@test numparams(rs) == 2
67-
addparam!(rs, Variable{Parameter{Real}}(:k1), disablechecks=true)
67+
addparam!(rs, k1, disablechecks=true)
6868
@test numparams(rs) == 3
6969

7070

@@ -78,4 +78,4 @@ smat = [1 2 0;
7878
pmat = [0 2 0;
7979
1 0 2]
8080
@test all(smat .== substoichmat(rnmat))
81-
@test all(pmat .== prodstoichmat(rnmat))
81+
@test all(pmat .== prodstoichmat(rnmat))

test/make_model.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ rs_3 = ReactionSystem(rxs_3, t, [X1,X2,X3,X4,X5], [k1,k2,k3])
316316
push!(identical_networks_4, reaction_networks_weird[7] => rs_3)
317317

318318
for networks in identical_networks_4
319-
@test independent_variable(networks[1]) == independent_variable(networks[2])
319+
@test isequal(independent_variable(networks[1]), independent_variable(networks[2]))
320320
@test alleq(get_states(networks[1]), get_states(networks[2]))
321321
@test alleq(get_ps(networks[1]), get_ps(networks[2]))
322322
@test ModelingToolkit.get_systems(networks[1]) == ModelingToolkit.get_systems(networks[2])

0 commit comments

Comments
 (0)