Skip to content

Commit

Permalink
Give type to avoid error when summing over empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
lily90502 authored and hwpang committed Oct 13, 2023
1 parent 60e0d20 commit 8e598be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ end
function rops(ssys::SystemSimulation, name, t)
domains = getfield.(ssys.sims, :domain)
ind = findfirst(isequal(name), ssys.names)
Nrxns = sum([length(sim.domain.phase.reactions) for sim in ssys.sims]) + sum([length(inter.reactions) for inter in ssys.interfaces if hasproperty(inter, :reactions)])
Nrxns = sum([length(sim.domain.phase.reactions) for sim in ssys.sims]) + sum(Vector{Int}([length(inter.reactions) for inter in ssys.interfaces if hasproperty(inter, :reactions)]))
Nspcs = sum([length(getphasespecies(sim.domain.phase)) for sim in ssys.sims])
cstot = zeros(Nspcs)
vns = Array{Any,1}(undef, length(domains))
Expand Down

0 comments on commit 8e598be

Please sign in to comment.