Skip to content

Commit 9a928fe

Browse files
committed
fixes
1 parent 9d62c28 commit 9a928fe

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/dsl.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,12 @@ end
577577
function get_rxexpr(rx::DSLReaction)
578578
# Initiates the `Reaction` expression.
579579
rate = recursive_escape_functions!(rx.rate)
580-
rx_constructor = :(Reaction($rate, nothing, nothing; metadata = $(rx.metadata)))
580+
subs_init = isempty(rx.substrates) ? nothing : :([])
581+
subs_stoich_init = deepcopy(subs_init)
582+
prod_init = isempty(rx.products) ? nothing : :([])
583+
prod_stoich_init = deepcopy(prod_init)
584+
rx_constructor = :(Reaction($rate, $subs_init, $subs_stoich_init, $prod_init,
585+
$prod_stoich_init; metadata = $(rx.metadata)))
581586

582587
# Loops through all products and substrates, and adds them (and their stoichiometries)
583588
# to the `Reaction` expression.
@@ -589,7 +594,6 @@ function get_rxexpr(rx::DSLReaction)
589594
push!(rx_constructor.args[5].args, prod.reactant)
590595
push!(rx_constructor.args[7].args, prod.stoichiometry)
591596
end
592-
593597
return rx_constructor
594598
end
595599

@@ -731,7 +735,7 @@ function read_equations_options!(diffsexpr, options, syms_unavailable, tiv; requ
731735
push!(diffsexpr.args, :(D = Differential($(tiv))))
732736
end
733737

734-
return vs_inferred, diffs_inferred, equations
738+
return collect(vs_inferred), diffs_inferred, equations
735739
end
736740

737741
# Searches an expression `expr` and returns true if it have any subexpression `D(...)` (where `...` can be anything).

0 commit comments

Comments
 (0)