From 32cda2ce557a60e9e4f4dacb279379f390a9b4c5 Mon Sep 17 00:00:00 2001 From: Sam Isaacson Date: Thu, 5 Jan 2023 12:04:13 -0500 Subject: [PATCH] compact checks --- src/problem.jl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/problem.jl b/src/problem.jl index fcad3d64..a5b366d2 100644 --- a/src/problem.jl +++ b/src/problem.jl @@ -187,17 +187,14 @@ function JumpProblem(prob, aggregator::AbstractAggregatorAlgorithm, jumps::JumpS if spatial_system !== nothing && hopping_constants !== nothing (num_crjs(jumps) == num_vrjs(jumps) == 0) || error("Spatial aggregators only support MassActionJumps currently.") - if !is_spatial(aggregator) + + if is_spatial(aggregator) + kwargs = merge((; hopping_constants, spatial_system), kwargs) + else prob, maj = flatten(maj, prob, spatial_system, hopping_constants; kwargs...) end end - if is_spatial(aggregator) - (num_crjs(jumps) == num_vrjs(jumps) == 0) || - error("Spatial aggregators only support MassActionJumps currently.") - kwargs = merge((; hopping_constants, spatial_system), kwargs) - end - ndiscjumps = get_num_majumps(maj) + num_crjs(jumps) # separate bounded variable rate jumps *if* the aggregator can use them