In the elegant wrapper where it calls csv2sdds, there is a warning about a bad escape sequence in a string.
Relevant code fragment:
# convert CSV to SDDS (ascii for now)
subprocess.call(CONFIG.elegant_exec + 'csv2sdds ' + tmpfile + ' ' + filename +
' -asciiOutput -columnData=name=x,type=double,units=m' +
' -columnData=name=xp,type=double' +
' -columnData=name=y,type=double,units=m' +
' -columnData=name=yp,type=double' +
' -columnData=name=t,type=double,units=s' +
' -columnData=name=p,type=double,units=\"m\$be\$nc\"' +
' -columnData=name=dt,type=double,units=s' +
' -columnData=name=particleID,type=ulong64', shell=True)
Link to the relevant line:
|
' -columnData=name=p,type=double,units=\"m\$be\$nc\"' + |
Warning:
abel/wrappers/elegant/elegant_wrapper.py:214
/home/kyrsjo/code/ABEL/abel/wrappers/elegant/elegant_wrapper.py:214: SyntaxWarning: invalid escape sequence '\$'
I don't know if you want to output "$" or "$" so I haven't made a PR, however if the wanted output is "$" then using either a raw string or escaping the backslash as in \\$ should work; if the wanted output is $ then no escape should be needed.
Also note that when using single-quote strings, you shouldn't need to escape double quotes.
To avoid needing escapes, consider using raw strings when appropriate.
In the elegant wrapper where it calls
csv2sdds, there is a warning about a bad escape sequence in a string.Relevant code fragment:
Link to the relevant line:
ABEL/abel/wrappers/elegant/elegant_wrapper.py
Line 214 in 7f8ecce
Warning:
I don't know if you want to output "$" or "$" so I haven't made a PR, however if the wanted output is "$" then using either a raw string or escaping the backslash as in
\\$should work; if the wanted output is$then no escape should be needed.Also note that when using single-quote strings, you shouldn't need to escape double quotes.
To avoid needing escapes, consider using raw strings when appropriate.