pysd: read_xmile error

Trying to read in an xmile exported from Vensim

model = pysd.read_xmile("test.xml")

…gives the error:

parsimonious.exceptions.ParseError: Rule ‘expr’ didn’t match at ’ Error generati’ (line 1, column 1).

But the same model loads ok as .mdl with read_vensim. I’m on Anaconda, python 3.6.6

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17

Most upvoted comments

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:

	<variables>
		<stock name="Stock">
			<eqn>50</eqn>
			<non_negative/>
		</stock>
	</variables>

Here’s the chunk of a model with a flow that does work:

	<variables>
		<stock name="Stock">
			<eqn>50</eqn>
			<inflow>Flow_1</inflow>
			<non_negative/>
		</stock>
		<flow name="Flow 1">
			<eqn>0</eqn>
			<non_negative/>
		</flow>
	</variables> 

Hi, I’m facing the same error, does anybody know how to deal with that? Thanks in advance