Fix Syntax Errors

Top  Previous  Next

Although the bulk of the conversion process is done by the tool, the process of importing a WaveTrain model and a runset is not completely automatic.  This is because WaveTrain maps everything into C++ and expressions for inputs, parameters and run variables follow C++ syntax  and can be any C++ expression. LightLike uses python and all of the expressions must follow python syntax.  While there are many similarities, some of the expressions must be handled by the user.

 

For example, to reference an element of a C++ Vector, one can use either parenthesis or square brackets, but in python it is square brackets only.

ImportWTModel4

 

 

 

TimeLike System Editor and TimeLike Runset Editor detect only a small subset of possible syntax errors. All other syntax errors are detected by python. Once all errors detected by TimeLike System Editor and RunsetEditor are fixed, execute the runset to see if there are any errors.

ImportWTFixSyntaxErrors2

 

 

ImportWTFixSyntaxErrors1

 

The python interpreter reports that there is a syntax error in line 42 of the BLAT01RunAtoG.py. Look at the python file to see which expression causes problems. In this particular case, the asterisk that is in front of tdm needs to be removed.

ImportWTFixSyntaxErrors3

 

 

Once this problem is fixed, rerunning the simulation reveals next problem:

ImportWTFixSyntaxErrors4

 

The solution for this issue is to replace the value 'stopTime' for the System Parameter tmax with some numeric value (e.g. 0.01).