Catalyst.jl
Catalyst.jl copied to clipboard
disallow repeated substrates or products in reactions
From https://discourse.julialang.org/t/read-in-network-does-not-match-hard-coded-network/81997/5
rx = @reaction k, A+A --> B
@parameters k
@variables t A(t) B(t)
rx2 = Reaction(k, [A,A], [B], [1,1], [1])
rx != rx2 # true
We need an error check here (perhaps with a kwarg to disable), or need to detect this and correct the substrates/products.
While I agree
rx = @reaction k, 2A --> B
is much better than
rx = @reaction k, A+A --> B
is there a strong reason to disallow the latter?
We support both notations via the DSL. The issue is in symbolically building Reaction
s -- they currently assume their inputs are unique, and I think they should stay that way for internal use. So we either need an error check in their constructor or we need to normalize them in the constructor by merging repeated species.