Skip to content

Commit f504b7a

Browse files
committed
clean up automatic mechanism string output
1 parent e6dc131 commit f504b7a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/AutomaticMechanismAnalysis.jl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,16 +665,28 @@ function getrxnanalysisstring(sim,ra;branchingcutoff=1e-2,branchfract=0.01)
665665
s *= "Associated key reaction path in $spname loss direction \n"
666666
for i = 1:length(rp.rxninds)
667667
rstr = getrxnstr(sim.reactions[rp.rxninds[i]])
668+
sgn = rp.spcsinds[i+1] in sim.reactions[rp.rxninds[i]].productinds
669+
if sgn
670+
sn = "+"
671+
else
672+
sn = "-"
673+
end
668674
br = round(rp.branchfracts[i],sigdigits=6)
669-
s *= "$rstr at path branching of $br \n"
675+
s *= "$rstr ($sn) at path branching of $br \n"
670676
end
671677
else
672678
s *= "Associated key reaction path in $spname production direction \n"
673679
revinds = reverse(rp.rxninds)
674680
for i = 1:length(rp.rxninds)
675681
rstr = getrxnstr(sim.reactions[revinds[i]])
682+
sgn = rp.spcsinds[i+1] in sim.reactions[rp.rxninds[i]].productinds
683+
if sgn
684+
sn = "+"
685+
else
686+
sn = "-"
687+
end
676688
br = round(rp.branchfracts[i],sigdigits=6)
677-
s *= "$rstr at path step branching of $br \n"
689+
s *= "$rstr ($sn) at path step branching of $br \n"
678690
end
679691
end
680692
s *= "\n"
@@ -684,7 +696,7 @@ function getrxnanalysisstring(sim,ra;branchingcutoff=1e-2,branchfract=0.01)
684696
for i = 1:length(ra.clusterprodlossfracts)
685697
if abs(ra.clusterprodlossfracts[i]) > branchfract
686698
cluster = ra.clusternames[i]
687-
fract = abs(ra.clusterprodlossfracts[i])
699+
fract = round(abs(ra.clusterprodlossfracts[i]),sigdigits=6)
688700
if ra.clusterprodlossfracts[i] > 0
689701
s *= "Reaction accounts for $fract of the net production for cluster $cluster \n"
690702
else

0 commit comments

Comments
 (0)