Skip to content

Commit e7b8752

Browse files
authored
Merge pull request #284 from isaacsas/jumpproblem-fix
Spatial JumpProblem validation check fix
2 parents 2afd123 + 32cda2c commit e7b8752

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/problem.jl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,15 @@ function JumpProblem(prob, aggregator::AbstractAggregatorAlgorithm, jumps::JumpS
184184
end
185185

186186
## Spatial jumps handling
187-
if spatial_system !== nothing && hopping_constants !== nothing &&
188-
!is_spatial(aggregator)
187+
if spatial_system !== nothing && hopping_constants !== nothing
189188
(num_crjs(jumps) == num_vrjs(jumps) == 0) ||
190189
error("Spatial aggregators only support MassActionJumps currently.")
191-
prob, maj = flatten(maj, prob, spatial_system, hopping_constants; kwargs...)
192-
end
193190

194-
if is_spatial(aggregator)
195-
(num_crjs(jumps) == num_vrjs(jumps) == 0) ||
196-
error("Spatial aggregators only support MassActionJumps currently.")
197-
kwargs = merge((; hopping_constants, spatial_system), kwargs)
191+
if is_spatial(aggregator)
192+
kwargs = merge((; hopping_constants, spatial_system), kwargs)
193+
else
194+
prob, maj = flatten(maj, prob, spatial_system, hopping_constants; kwargs...)
195+
end
198196
end
199197

200198
ndiscjumps = get_num_majumps(maj) + num_crjs(jumps)

0 commit comments

Comments
 (0)