Skip to content

Commit 18f8478

Browse files
committed
style fixes
1 parent 0a31c19 commit 18f8478

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

ext/CatalystGraphMakieExtension/rn_graph_plot.jl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ Wrapper intended to allow plotting of multiple edges. This is needed in the foll
1414
struct MultiGraphWrap{T} <: Graphs.AbstractGraph{T}
1515
g::SimpleDiGraph{T}
1616
multiedges::Vector{Graphs.SimpleEdge{T}}
17-
"""sets the drawing order of the edges. Needed because multiedges need to be consecutive to be drawn properly."""
17+
"""Sets the drawing order of the edges. Needed because multiedges need to be consecutive to be drawn properly."""
1818
edgeorder::Vector{Int64}
1919
end
2020

2121
# Create the SimpleDiGraph corresponding to the species and reactions, the species-reaction graph
2222
function SRGraphWrap(rn::ReactionSystem)
2323
srg = species_reaction_graph(rn)
2424
multiedges = Vector{Graphs.SimpleEdge{Int}}()
25-
sm = speciesmap(rn); specs = species(rn)
25+
sm = speciesmap(rn)
26+
specs = species(rn)
2627

2728
deps = Set()
2829
for (i, rx) in enumerate(reactions(rn))
@@ -51,8 +52,10 @@ end
5152

5253
# Return the multigraph and reaction order corresponding to the complex graph. The reaction order is the order of reactions(rn) that would match the edge order given by g.edgeorder.
5354
function ComplexGraphWrap(rn::ReactionSystem)
54-
img = incidencematgraph(rn); D = incidencemat(rn; sparse=true)
55-
specs = species(rn); rxs = reactions(rn)
55+
img = incidencematgraph(rn)
56+
D = incidencemat(rn; sparse=true)
57+
specs = species(rn)
58+
rxs = reactions(rn)
5659

5760
deps = Set()
5861
edgelist = Vector{Graphs.SimpleEdge{Int}}()
@@ -71,7 +74,8 @@ function ComplexGraphWrap(rn::ReactionSystem)
7174
get_variables!(deps, rx.rate, specs)
7275
end
7376

74-
rxorder = sortperm(edgelist); edgelist = edgelist[rxorder]
77+
rxorder = sortperm(edgelist)
78+
edgelist = edgelist[rxorder]
7579
multiedges = Vector{Graphs.SimpleEdge{Int}}()
7680
for i in 2:length(edgelist)
7781
isequal(edgelist[i], edgelist[i-1]) && push!(multiedges, edgelist[i])
@@ -163,7 +167,8 @@ function Catalyst.plot_network(rn::ReactionSystem; kwargs...)
163167
ilabels = vcat(map(s -> String(tosymbol(s, escape=false)), species(rn)),
164168
["R$i" for i in 1:nv(srg)-ns])
165169

166-
ssm = substoichmat(rn); psm = prodstoichmat(rn)
170+
ssm = substoichmat(rn)
171+
psm = prodstoichmat(rn)
167172
# Get stoichiometry of reaction
168173
edgelabels = map(Graphs.edges(srg.g)) do e
169174
string(src(e) > ns ?
@@ -218,7 +223,8 @@ end
218223
For a list of accepted keyword arguments to the graph plot, please see the [GraphMakie documentation](https://graph.makie.org/stable/#The-graphplot-Recipe).
219224
"""
220225
function Catalyst.plot_complexes(rn::ReactionSystem; kwargs...)
221-
rxs = reactions(rn); specs = species(rn)
226+
rxs = reactions(rn)
227+
specs = species(rn)
222228
edgecolors = [:black for i in 1:length(rxs)]
223229
edgelabels = [repr(rx.rate) for rx in rxs]
224230

0 commit comments

Comments
 (0)