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
Separating the translation from the building may allow us to easily add more features in PySD.
One possible option is building a class that contains each element information and an abstract syntax tree (AST) using Vensim or Vensim-like notation.
Then we can apply a builder over this syntax tree. Some profits from this approach:
Merge in better way elements from different equations, making the output code much cleaner and faster
Identify better the operations inside Vensim definition, it will make it possible to identify the final subscript after any operation and thus to move to numpy.array based backend instead of xarray.DataArray, see also Identifying subscripts as Vensim does #301
Allow flexible translation to other languages, the AST can be used to build model elements in other languages or for example to Latex documents with the mathematical expressions or other coding languages.
Better debugging, if we split the translation from the building we will be able to better understand if we have some functions missing in PySD or the code from Vensim is corrupted.
Easier maintenance of Xmile-Vensim together, building the AST with Xmile models as well as with Vensim models will allow us to easily maintain both translators, as we only will have the syntax for splitting the information.
The text was updated successfully, but these errors were encountered:
Separating the translation from the building may allow us to easily add more features in PySD.
One possible option is building a class that contains each element information and an abstract syntax tree (AST) using Vensim or Vensim-like notation.
Then we can apply a builder over this syntax tree. Some profits from this approach:
The text was updated successfully, but these errors were encountered: