From e75fda0fb04465c751f651d29f2ba2678590e6f9 Mon Sep 17 00:00:00 2001 From: Torkel Date: Tue, 21 Nov 2023 15:08:53 -0500 Subject: [PATCH] up --- Project.toml | 1 + src/spatial_reaction_systems/utility.jl | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index e982285872..c43b053c36 100644 --- a/Project.toml +++ b/Project.toml @@ -41,6 +41,7 @@ ModelingToolkit = "8.66" Parameters = "0.12" Reexport = "0.2, 1.0" Requires = "1.0" +RuntimeGeneratedFunctions = "0.5.12" SymbolicUtils = "1.0.3" Symbolics = "5.0.3" Unitful = "1.12.4" diff --git a/src/spatial_reaction_systems/utility.jl b/src/spatial_reaction_systems/utility.jl index b987b2032f..8e6543a2b3 100644 --- a/src/spatial_reaction_systems/utility.jl +++ b/src/spatial_reaction_systems/utility.jl @@ -210,14 +210,13 @@ function compute_transport_rates(rate_law::Num, # If all these parameters are spatially uniform. `rates` becomes a vector with 1 value. if all(length(p_val_dict[P]) == 1 for P in relevant_ps) - rates = [rate_law_func([p_val_dict[p][1] for p in relevant_ps]...)] + return [rate_law_func([p_val_dict[p][1] for p in relevant_ps]...)] # If at least on parameter the rate depends on have a value varying across all edges, # we have to compute one rate value for each edge. else - rates = [rate_law_func([get_component_value(p_val_dict[p], idxE) for p in relevant_ps]...) + return [rate_law_func([get_component_value(p_val_dict[p], idxE) for p in relevant_ps]...) for idxE in 1:num_edges] end - return Symbolics.value.(rates) end # Creates a map, taking each species (with transportation) to its transportation rate.