Support for multiple vensim views #360
-
Hey @enekomartinmartinez - do we have support for multiple views at the moment? Is there a test in the test-models that demonstrates this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Yes, having more than one view doesn't change the translation. As the equations are written in the first part of the mdl file where there are no differences between views. The views are only defined in the sketch part, in fact we support parsing the sketch to identify the different views and classify the variables in different files depending on which view they are present. It also allows multi-level for example if you have the views:
This could be identified with the separators modules
Check the documentation https://pysd.readthedocs.io/en/master/advanced_usage.html#splitting-vensim-views-in-separate-python-files-modules This feature is tested using the models in the following folder: https://github.com/JamesPHoughton/pysd/tree/master/tests/more-tests |
Beta Was this translation helpful? Give feedback.
-
@enekomartinmartinez May I ask whether this feature has been added recently? Last time I checked it wasn't there (perhaps I was mistaken) and the test script https://github.com/SDXorg/pysd/blob/master/tests/pytest_translators/pytest_split_views.py is from 16 days ago. (In either way, if we can do this, this is definitely a good news.) |
Beta Was this translation helpful? Give feedback.
Yes, having more than one view doesn't change the translation. As the equations are written in the first part of the mdl file where there are no differences between views.
The views are only defined in the sketch part, in fact we support parsing the sketch to identify the different views and classify the variables in different files depending on which view they are present. It also allows multi-level for example if you have the views:
This could be identified with the separators
[".", "-"]
and therefore produce the following file structure