Update `Reaction` constructor
- Permits
[]andnothingto be used interchangeably (previously there were some cases which unintentionally would not work). - Ensures that the
Reactionstructure is concretely typed.
Actually, now I think this is a bad idea. Someone has made the confusing choice to define get_variables(e::Equation) completely inconsistently with get_variables! in Symbolics, where the latter gets dependent variables (so rhs only).
I think if we want such a function for Reactions we should come up with a different name to avoid confusion (since we already have get_variables! defined on it).
Do you mean this definition:
# determine which unknowns a reaction depends on
function MT.get_variables!(deps::Set, rx::Reaction, variables)
(rx.rate isa Symbolic) && get_variables!(deps, rx.rate, variables)
for s in rx.substrates
# parametric stoichiometry means may have a parameter as a substrate
any(isequal(s), variables) && push!(deps, s)
end
deps
end
and this PR https://github.com/SciML/Catalyst.jl/pull/855?
To do get_variables(x) where you return a vector of all the symbolic variables in x (whatever it is) is (to me) the established way to use the function, so get_variables(rx::Reaction) makes sense. Practically, I think we should have some function that does this, as it seems like something genuinely useful.