Skip to content

Commit ce8e110

Browse files
committed
fixes
1 parent 3f1d1ca commit ce8e110

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/network_analysis.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ function fluxmat(rn::ReactionSystem, pmap::Dict = Dict(); sparse=false)
221221
nc = length(rcmap)
222222
nr = length(rates)
223223
mtype = eltype(rates) <: Symbolics.BasicSymbolic ? Num : eltype(rates)
224-
fluxmat = if sparse
224+
mat = if sparse
225225
fluxmat(SparseMatrixCSC{mtype, Int}, rcmap, rates)
226226
else
227227
fluxmat(Matrix{mtype}, rcmap, rates)
228228
end
229-
mtype == Num ? Matrix{Any}(fluxmat) : fluxmat
229+
mtype == Num ? Matrix{Any}(mat) : mat
230230
end
231231

232232
function fluxmat(::Type{SparseMatrixCSC{T, Int}}, rcmap, rates) where T
@@ -250,8 +250,7 @@ function fluxmat(::Type{Matrix{T}}, rcmap, rates) where T
250250
nc = length(rcmap)
251251
K = zeros(T, nr, nc)
252252
for (i, (complex, rxs)) in enumerate(rcmap)
253-
for (rx, dir) in rxs
254-
dir == -1 && (K[rx, i] = rates[rx])
253+
for (rx, dir) in rxs dir == -1 && (K[rx, i] = rates[rx])
255254
end
256255
end
257256
K

test/network_analysis/network_properties.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ let
379379
]
380380
@test isequal(Φ, truevec)
381381

382-
K = fluxmat(MAPK)
382+
K = Catalyst.fluxmat(MAPK)
383383
# Construct matrix from incidence matrix
384384
mat = zeros(Num, 30, 26)
385385
D = incidencemat(MAPK)
@@ -396,7 +396,7 @@ let
396396
@test isequal(K[3, 2], MAPK.k₃)
397397
@test all(==(0), vcat(K[3,1], K[3,3:end]))
398398
@test count(k -> !isequal(k, 0), K) == length(reactions(MAPK))
399-
K = fluxmat(MAPK; sparse = true)
399+
K = Catalyst.fluxmat(MAPK; sparse = true)
400400
@test Catalyst.issparse(K)
401401

402402
A_k = Catalyst.laplacianmat(MAPK)

0 commit comments

Comments
 (0)