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
I am using OMPython version 3.3.0, Python version 3.8. When calling "getComponents", the OMTypedParser breaks if a parameter has a variable length array. See below
test.py
fromOMPythonimportOMCSessionZMQif__name__=="__main__":
model=""" model Test parameter Real TEST[:,2] = [0,1;100,2]; end Test; """omc=OMCSessionZMQ()
omc.sendExpression("loadString(\"{}\")".format(model))
# Breaksprint(omc.sendExpression("getComponents(Test)"))
Error:
Traceback (most recent call last):
File ".../test.py", line 15, in <module>
print(omc.sendExpression("getComponents(Test)"))
File ".../venv/lib/python3.8/site-packages/OMPython/__init__.py", line 778, in sendExpression
answer = OMTypedParser.parseString(result)
File ".../venv/lib/python3.8/site-packages/OMPython/OMTypedParser.py", line 120, in parseString
res = omcGrammar.parseString(string)
File ".../venv/lib/python3.8/site-packages/pyparsing.py", line 1955, in parseString
raise exc
File ".../venv/lib/python3.8/site-packages/pyparsing.py", line 3814, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pyparsing.ParseException: Expected end of text, found '{' (at char 0), (line:1, col:1)
If I replace ":" with "2", the issue goes away and returns the expected result.
The text was updated successfully, but these errors were encountered:
I am using OMPython version 3.3.0, Python version 3.8. When calling "getComponents", the OMTypedParser breaks if a parameter has a variable length array. See below
test.py
Error:
If I replace ":" with "2", the issue goes away and returns the expected result.
The text was updated successfully, but these errors were encountered: