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
That sounds interesting. What would be a use-case for storing the equations graph? What about forward compatibility, if we skip the parsing of the equation string and just rely that this graph will be future proof?
Currently I can only things which could cause trouble instead of any worth benefit.
In my opinion the main benefit would be that you could make sure the equation is actually valid since there is no syntax check (before loading) on the strings in the schema
However the overhead is certainly large
Isn't the expression string cast into a Sympy expression before serialization? If so, it would already be checked to be valid, right?
Yes on the python side everything should be checked when loading but there is no validation on an ASDF level
If you would create an ASDF file with an invalid expression you will end up with a sympy error when loading the file. Ideally in cases like these there should be a ValidationError before anyhting sympy related happens. (since the ASDF file should be valid independent from sympy or any other python implementation)
Currently we store the sympy equations as strings which is very accessible and simple to use
In case a more 'robust' solution is required in the future we could also think about storing the equation in graph form using
sympy.dotprint
https://docs.sympy.org/latest/tutorial/printing.html#dotsympy
->dot
->networkx
It would be similiar to what asdf is doing in their schemas but might be more flexible overal
The text was updated successfully, but these errors were encountered: