Skip to content

Commit b685402

Browse files
committed
always check if rate is an Operation
1 parent e534014 commit b685402

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/graphs.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ end
2020
function edgifyrates(rxs, specs)
2121
es = Edge[]
2222
for (i,rx) in enumerate(rxs)
23-
deps = get_variables(rx.rate, specs)
23+
deps = rx.rate isa Operation ? get_variables(rx.rate, specs) : Operation[]
2424
for dep in deps
2525
val = String(dep.op.name)
2626
attr = Attributes(:color => "#d91111", :style => "dashed")
@@ -30,6 +30,7 @@ function edgifyrates(rxs, specs)
3030
end
3131
es
3232
end
33+
3334
"""
3435
Graph(rn::ReactionSystem)
3536

src/latexify_recipes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function chemical_arrows(rn::ModelingToolkit.ReactionSystem;
5757
str *= "\\ce{ "
5858

5959
### Expand functions to maths expressions
60-
rate = Expr(r.rate)
60+
rate = r.rate isa Operation ? Expr(r.rate) : r.rate
6161
expand && (rate = recursive_clean!(rate))
6262
expand && (rate = recursive_clean!(rate))
6363

0 commit comments

Comments
 (0)