-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read_xmile error #198
Comments
That's interesting. Did the xmile export from vensim work properly? If you open the xmile file in a text editor, do you see properly formatted XML? It looks to me like the xmile file starts with an error message, just from what you've posted. |
As far as I can see it is valid and as exported successfully..
|
Same here – I can't seem to be able to read any xmile file (from Stella), generally same error. Any advice? |
Hi, my case is slightly different - after one time successfully reading .stmx file, the file itself gets overwritten to the translated .py file and can't be read in anymore (and the Stella model is therefore lost) |
Hi again, I guess I found where the problem (in my last post) comes from: in the end of the file "pysd/pysd/py_backend/xmile/xmile2py.py", a line writes:
However, if the original file is a '.stmx' file instead of a '.xmile' file, this line won't do anything and the original filename is therefore passed back to write out. That is what happened to me, because I found '.stmx' file can actually be directly read in. Luckily I had a backup for this model. Please could you do something with this? It is a 'dangerous' issue since people could just try their Stella model with PySD without a backup. Thanks |
I'm having a similar issue when trying to parse Macro expressions in xmile format:
As well as: |
@meuseky, i'm sorry, but for now macro expressions is not supported by xmile :( |
@alexprey By XMile or by PySD? The XMile spec seems to support them: http://docs.oasis-open.org/xmile/xmile/v1.0/cs01/xmile-v1.0-cs01.html#_Toc403385655 |
@meuseky, i mean in pysd implementation :) |
Same here. I cannot open any xmile files from Stella. |
Hi @aclarkData, can you please provide example of you model, that is not work :) Alexey, sdCloud.io dev. Team |
Yes sir! Below is a link to an official Stella model example from IEEE Systems. Very simple models appear to import, but when the equations become more involved, the parser breaks down. https://github.com/aclarkData/PublicTransfer/blob/master/Headcount-Strategy.xmile |
I stumbled upon what I think is a related error in parsing XMILE from a Stella file XMILE. Having a stock without a flow seems to cause all kinds of problems. In some ways, it's a trivial situation, but problematic nonetheless since one might have stocks without flows as a placeholder while one is building a model. Here's the chunk of a model without a stock that fails to import:
Here's the chunk of a model with a flow that does work:
|
Hi, I'm facing the same error, does anybody know how to deal with that? |
I'm also encountering the "Rule 'expr' didn't match" error, for what its worth. So any workaround would be appreciated. |
We probably should have some more explicit error messaging here. This is the generic error that is thrown when the XMILE translator encounters something it doesn't recognize. Unfortunately the workarounds aren't very satisfying. If you have access to Vensim, you might try translating the model to Vensim format first and then loading with PySD. PySD's Vensim translator is much more well-established. If it's a simple feature, you might try modifying the XMILE parser and submitting a pull request - we love contributions. =) The least satisfying solution is to rework the model so it only uses the currently supported features. =/ @enekomartinmartinez do you think it would be worth including something in the docs about common errors? This would be top of the list... |
I think it would be useful to add a FAQs, Common errors, or Troubleshooting section in the documentation to include information about common parsing and runtime errors and the possible solutions. we can describe error, their solutions and also link them to already solved issues. We should start by making a list of these errors. I don't think I'll have time to work on this in the next few weeks, but we can start by listing the issues we want to include. Moreover, in order to make xmile translator errors more readable maybe something similar to vensim could be done, printing the full expression when an error is found after the parsimonious error (see vensim2py parsing error in get equation components and vensim2py parsing error in general expression) |
Trying to read in an xmile exported from Vensim
model = pysd.read_xmile("test.xml")
..gives the error:
But the same model loads ok as .mdl with read_vensim. I'm on Anaconda, python 3.6.6
The text was updated successfully, but these errors were encountered: