From 1ecbc2f0c634999b8f3bc3f1f10f241d32845d8a Mon Sep 17 00:00:00 2001 From: Samuel Isaacson Date: Thu, 20 May 2021 14:43:28 -0400 Subject: [PATCH] add kwarg-based JumpSet constructor --- src/jumps.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/jumps.jl b/src/jumps.jl index 3eca921c..f6c73635 100644 --- a/src/jumps.jl +++ b/src/jumps.jl @@ -99,7 +99,10 @@ JumpSet(jump::ConstantRateJump) = JumpSet((),(jump,),nothing,nothing) JumpSet(jump::VariableRateJump) = JumpSet((jump,),(),nothing,nothing) JumpSet(jump::RegularJump) = JumpSet((),(),jump,nothing) JumpSet(jump::MassActionJump) = JumpSet((),(),nothing,jump) -JumpSet() = JumpSet((),(),nothing,nothing) +function JumpSet(; variable_jumps=(), constant_jumps=(), + regular_jumps=nothing, massaction_jumps=nothing) + JumpSet(variable_jumps, constant_jumps, regular_jumps, massaction_jumps) +end JumpSet(jb::Nothing) = JumpSet() # For Varargs, use recursion to make it type-stable