exprdef test definitions:
>>> from lxml import etree
>>> import datetime
>>> from pprint import pprint
>>> from simo.builder.output.exprdef import ExpressionOutputDef
>>> tdf = open('../../simulator/xml/schemas/Typedefs_SIMO.xsd')
>>> typedef = tdf.read()
>>> tdf.close()
>>> sf = open('../../simulator/xml/schemas/expression_definition.xsd')
>>> schema = sf.read()
>>> sf.close()
>>> xml = '''<?xml version="1.0" encoding="UTF-8"?>
... <expression_definition
... xmlns="http://www.simo-project.org/simo"
... xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
... xsi:schemaLocation="http://www.simo-project.org/simo
... ../schemas/item_definition.xsd">
... <initial_date>2009-01-01</initial_date>
... <discount_rate>3.0</discount_rate>
... <expressions>
... <item>
... <expression>sum[-1:-1](stratum:SP*stratum:HgM)</expression>
... <label>1st item</label>
... </item>
... <item>
... <expression>sum[-1:-1](operation:Volume)</expression>
... <label>2nd item</label>
... </item>
... </expressions>
... </expression_definition>'''
Expression output definitions.
>>> aodef = ExpressionOutputDef(typedef)
>>> aodef.schema = schema
>>> aodef.xml = ('test data', xml, None)
Expressionoutput info.
>>> ao = aodef.obj['test data']
>>> pprint(ao.data)
{'discount_rate': 3.0,
'expression_variables': [{'expression': 'sum[-1:-1](stratum:SP*stratum:HgM)',
'label': '1st item'},
{'expression': 'sum[-1:-1](operation:Volume)',
'label': '2nd item'}],
'initial_date': datetime.date(2009, 1, 1)}
Parses the agregation output instructions into self.data