Closed jcschaff closed 1 year ago
There's other issues with the mathml-to-infix converter, most obviously the inclusion of units--you can get stuff like "1 mL * S1" and the like. And you'll also have issues with true, false, avogadro, other built-in functions... I'll make a list and file a new bug report.
@luciansmith it seems that we can avoid some of these issues if we work directly with the expression ASTNodes, or ask libsbml/libsedml to validate and/or evaluate the expression for us.
@jonrkarr please weigh in on this issue. This power operator is blocking VCell/Biosimulators interoperability.
I didn't read Lucian's post carefully enough - he suggested to file a new Issue for expanded expression compatibility support (e.g. units). I will merge the associated approved PR (by Eran) and close this issue.
if the MathML for a computeChange contains a 'pow', the infix notation from returned by libsedml.formulaToL3String() represents the pow operator as '^' and python represents it as '**'. During validation of a computed change, this infix representation (stored in change.math) is evaluated and fails if the operands are not compatible with bitwise XOR (e.g. if either operand is a float)
The suggested fix in Biosimulators_utils/sedml/math.py is to replace '^' with '**' as follows: