-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
In the example below, it looks like the "beam;" command is not sent to mad, although it appears in the command log. Splitting the input string in two parts does not show the problem.
from cpymad.madx import Madx
mad=Madx(command_log="log1.madx")
mad.input("""
l1=1; l2=1; l3=1; l4=1;
mb1: sbend, angle:=a1, l:=l1,tilt:=t1;
mb2: sbend, angle:=a2, l:=l2,tilt:=t2;
mb3: sbend, angle:=a3, l:=l3,tilt:=t3;
mb4: sbend, angle:=a4, l:=l4,tilt:=t4;
myseq : line =(mb1,mb2,mb3,mb4);
beam; """)
try:
mad.use(sequence="myseq")
except RuntimeError:
print("beam command seems ignored")
mad=Madx(command_log="log2.madx")
mad.input("""
l1=1; l2=1; l3=1; l4=1;
mb1: sbend, angle:=a1, l:=l1,tilt:=t1;
mb2: sbend, angle:=a2, l:=l2,tilt:=t2;
mb3: sbend, angle:=a3, l:=l3,tilt:=t3;
mb4: sbend, angle:=a4, l:=l4,tilt:=t4;
myseq : line =(mb1,mb2,mb3,mb4);
""")
mad.input("beam;")
mad.use(sequence="myseq")
print("works")
Metadata
Metadata
Assignees
Labels
No labels