You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The libsedml.formulaToL3String() (inherited from libsbml) will often work as-is to be interpretable in Python, but there are many cases where it will not. Issue #118 fixed one of them, but several remain. I'll try to come up with a complete list:
'true' -> 'True'
'false' -> 'False'
'avogadro' -> '6.02214179e23'
'delay' -> error
'rateOf' -> error
'piecewise' -> write your own function (or find it somewhere?)
'plus', 'minus', and 'times' with zero or one argument (I think you can collapse some of this with an appropriate argument to 'formulaToL3String')
'exp' -> something (exp(x) == e to the power of x)
'ln', 'log', and 'log10' -> You can set the formulaToL3String to convert these differently, but need to import the functions from somwehre
All the trig functions need to be imported
All the units need to be removed
Note that avogadro is explicitly defined as exactly that value in libsbml, even though avogadro's number is now different than it was when the SBML spec first introduced the symbol. libsedml doesn't say anything about avogadro, of course, but
I had the vague memory of doing something like this before, and managed to find it:
Looks like I didn't get everything above, but a lot of it is there. Seems like the math functions can be imported from a combination of 'math' and 'mpmath', and you have to write your own 'piecewise' function a la
Looking at the actual code, most of this is indeed already handled, which is great. And I'm not sure if the sbml-specific csymbols (avogadro, delay, rateOf) are allowed in SED-ML anyway, so those are probably fine. But the units definitely need to be removed, and the functions with 0/1 arguments probably should be dealt with, though this probably won't come up very often, if at all.
The libsedml.formulaToL3String() (inherited from libsbml) will often work as-is to be interpretable in Python, but there are many cases where it will not. Issue #118 fixed one of them, but several remain. I'll try to come up with a complete list:
Note that avogadro is explicitly defined as exactly that value in libsbml, even though avogadro's number is now different than it was when the SBML spec first introduced the symbol. libsedml doesn't say anything about avogadro, of course, but
I had the vague memory of doing something like this before, and managed to find it:
https://github.com/luciansmith/sedml-script/blob/master/parser/src/registry.cpp#L335
Looks like I didn't get everything above, but a lot of it is there. Seems like the math functions can be imported from a combination of 'math' and 'mpmath', and you have to write your own 'piecewise' function a la
https://github.com/luciansmith/sedml-script/blob/master/parser/src/registry.cpp#L471
The text was updated successfully, but these errors were encountered: