StochSS / GillesPy2

Modeling toolkit for biochemical simulation
http://gillespy2.readthedocs.io/
GNU General Public License v3.0
73 stars 33 forks source link

C++ solvers: models with exponents in ODE propensities will not compile #586

Closed jtcooper10 closed 2 years ago

jtcooper10 commented 3 years ago

Converting a Python expression string to a "polyglot" string (for example, changing the Python exponent operator ** to an explicit call to pow()) occurs for Reaction.propensity_function here, but only the stochastic propensity function is parsed and converted.

Any model which makes use of the Reaction.ode_propensity_function property will not be converted. As a result an unmodified Python expression will be passed to the C++ solver, and certain operations will either return unexpected results (namely the ^ operator) or fail to compile (the ** operator).

Can be replicated by attempting to import this SBML model. Should be addressed in PR #582, but as a temporary workaround the ** and ^ operators in ode_propensity_function may be manually replaced, for example change x**2 to pow(x, 2).

jtcooper10 commented 2 years ago

This was fixed in #582.