Skip to content

Commit ff89e56

Browse files
Merge pull request #481 from isaacsas/get_variables-fix
don't call get_variables! on non-Operations for jumps
2 parents f5b6baa + 65b10b6 commit ff89e56

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/systems/jumps/jumpsystem.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,14 @@ end
256256

257257

258258
### Functions to determine which states a jump depends on
259-
get_variables!(dep, jump::Union{ConstantRateJump,VariableRateJump}, variables) = get_variables!(dep, jump.rate, variables)
259+
function get_variables!(dep, jump::Union{ConstantRateJump,VariableRateJump}, variables)
260+
(jump.rate isa Operation) && get_variables!(dep, jump.rate, variables)
261+
dep
262+
end
260263

261264
function get_variables!(dep, jump::MassActionJump, variables)
262-
get_variables!(dep, jump.scaled_rates, variables)
265+
sr = jump.scaled_rates
266+
(sr isa Operation) && get_variables!(dep, sr, variables)
263267
for varasop in jump.reactant_stoch
264268
(varasop[1].op in variables) && push!(dep, varasop[1])
265269
end

0 commit comments

Comments
 (0)