Skip to content

Commit cf06b22

Browse files
committed
round 4
1 parent 8fae168 commit cf06b22

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

src/chemistry_functionality.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ function make_compound(expr)
105105
isempty(ivs) && (species_expr = insert_independent_variable(species_expr, :(..)))
106106

107107
# Expression which when evaluated gives a vector with all the ivs of the components.
108-
ivs_get_expr = :(unique(reduce(vcat, [arguments(ModelingToolkit.unwrap(comp))
109-
for comp in $components])))
108+
ivs_get_expr = :(unique(reduce(
109+
vcat, [arguments(ModelingToolkit.unwrap(comp))
110+
for comp in $components])))
110111

111112
# Creates the found expressions that will create the compound species.
112113
# The `Expr(:escape, :(...))` is required so that the expressions are evaluated in

src/dsl.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ function push_reactions!(reactions::Vector{ReactionStruct}, sub_line::ExprValues
476476
error("Some reaction metadata fields where repeated: $(metadata_entries)")
477477
end
478478

479-
push!(reactions, ReactionStruct(get_tup_arg(sub_line, i),
480-
get_tup_arg(prod_line, i), get_tup_arg(rate, i), metadata_i))
479+
push!(reactions,
480+
ReactionStruct(get_tup_arg(sub_line, i),
481+
get_tup_arg(prod_line, i), get_tup_arg(rate, i), metadata_i))
481482
end
482483
end
483484

@@ -773,8 +774,9 @@ function read_observed_options(options, species_n_vars_declared, ivs_sorted)
773774
# then we get something like :([:X1, :X2]), rather than :([X1, X2]).
774775
dep_var_expr = :(filter(!MT.isparameter,
775776
Symbolics.get_variables($(obs_eq.args[3]))))
776-
ivs_get_expr = :(unique(reduce(vcat, [arguments(MT.unwrap(dep))
777-
for dep in $dep_var_expr])))
777+
ivs_get_expr = :(unique(reduce(
778+
vcat, [arguments(MT.unwrap(dep))
779+
for dep in $dep_var_expr])))
778780
ivs_get_expr_sorted = :(sort($(ivs_get_expr);
779781
by = iv -> findfirst(MT.getname(iv) == ivs for ivs in $ivs_sorted)))
780782
push!(observed_vars.args,

src/spatial_reaction_systems/spatial_ODE_systems.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function build_odefunction(lrs::LatticeReactionSystem, vert_ps::Vector{Vector{T}
171171
set_nonzero = true)
172172
if sparse
173173
f = LatticeTransportODEf(ofunc_sparse, vert_ps, transport_rates, edge_ps, lrs)
174-
jac_vals = build_jac_prototype( ofunc_sparse.jac_prototype, transport_rates,
174+
jac_vals = build_jac_prototype(ofunc_sparse.jac_prototype, transport_rates,
175175
lrs; set_nonzero = true)
176176
J = LatticeTransportODEjac(ofunc_dense, vert_ps, lrs, jac_vals, edge_ps, true)
177177
jac_prototype = jac_vals
@@ -184,7 +184,7 @@ function build_odefunction(lrs::LatticeReactionSystem, vert_ps::Vector{Vector{T}
184184
if sparse
185185
ofunc_sparse = ODEFunction(osys; jac = false, sparse = true)
186186
f = LatticeTransportODEf(ofunc_sparse, vert_ps, transport_rates, edge_ps, lrs)
187-
jac_prototype = build_jac_prototype(ofunc_sparse.jac_prototype,
187+
jac_prototype = build_jac_prototype(ofunc_sparse.jac_prototype,
188188
transport_rates, lrs; set_nonzero = false)
189189
else
190190
ofunc_dense = ODEFunction(osys; jac = false, sparse = false)

src/spatial_reaction_systems/spatial_reactions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ function check_spatial_reaction_validity(rs::ReactionSystem, tr::TransportReacti
9696
if any(isequal(tr.species, s) && !isequivalent(tr.species, s) for s in species(rs))
9797
error("A transport reaction used a species, $(tr.species), with metadata not matching its lattice reaction system. Please fetch this species from the reaction system and used in transport reaction creation.")
9898
end
99-
if any(isequal(rs_p, tr_p) && !isequivalent(rs_p, tr_p) for rs_p in parameters(rs),
100-
tr_p in Symbolics.get_variables(tr.rate))
99+
if any(isequal(rs_p, tr_p) && !isequivalent(rs_p, tr_p)
100+
for rs_p in parameters(rs), tr_p in Symbolics.get_variables(tr.rate))
101101
error("A transport reaction used a parameter with metadata not matching its lattice reaction system. Please fetch this parameter from the reaction system and used in transport reaction creation.")
102102
end
103103

0 commit comments

Comments
 (0)