Skip to content

Commit

Permalink
always check if rate is an Operation
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsas committed Aug 11, 2020
1 parent e534014 commit b685402
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/graphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ end
function edgifyrates(rxs, specs)
es = Edge[]
for (i,rx) in enumerate(rxs)
deps = get_variables(rx.rate, specs)
deps = rx.rate isa Operation ? get_variables(rx.rate, specs) : Operation[]
for dep in deps
val = String(dep.op.name)
attr = Attributes(:color => "#d91111", :style => "dashed")
Expand All @@ -30,6 +30,7 @@ function edgifyrates(rxs, specs)
end
es
end

"""
Graph(rn::ReactionSystem)
Expand Down
2 changes: 1 addition & 1 deletion src/latexify_recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function chemical_arrows(rn::ModelingToolkit.ReactionSystem;
str *= "\\ce{ "

### Expand functions to maths expressions
rate = Expr(r.rate)
rate = r.rate isa Operation ? Expr(r.rate) : r.rate
expand && (rate = recursive_clean!(rate))
expand && (rate = recursive_clean!(rate))

Expand Down

0 comments on commit b685402

Please sign in to comment.