Skip to content

Commit

Permalink
Re-enable asserts in coasting example
Browse files Browse the repository at this point in the history
  • Loading branch information
giadarol committed Sep 17, 2024
1 parent 383df52 commit fbbf97b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions examples/coasting/001_frev_meas.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ def y_mean_hist(line, particles):
print('f_measured: ', f_measured, ' Hz')
print('Error: ', f_measured - f_expected, 'Hz')

# assert np.isclose(f_expected, f_measured, rtol=0, atol=2) # 2 Hz tolerance
# assert np.isclose(np.mean(inten), inten_exp, rtol=1e-2, atol=0)
# assert np.allclose(p.at_turn, num_turns*0.9, rtol=3e-2, atol=0) #beta1 defaults to 0.1
assert np.isclose(f_expected, f_measured, rtol=0, atol=2) # 2 Hz tolerance
assert np.isclose(np.mean(inten), inten_exp, rtol=1e-2, atol=0)
assert np.allclose(p.at_turn, num_turns*0.9, rtol=3e-2, atol=0) #beta1 defaults to 0.1

tt = line.get_table()
tt_synch = tt.rows[tt.element_type=='SyncTime']
Expand Down
20 changes: 10 additions & 10 deletions examples/radiation/009a_sps_with_vertical_bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
deferred_expressions=True)
line.particle_ref = xt.Particles(mass0=xt.ELECTRON_MASS_EV,
q0=-1, gamma0=mad.sequence.sps.beam.gamma)
line.cycle('bpv.11706_entry', inplace=True)
line.cycle('bpv.11706', inplace=True)

line.insert_element(element=line['actcse.31632'].copy(), index='bpv.11706_entry',
line.insert_element(element=line['actcse.31632'].copy(), index='bpv.11706',
name='cav1')
line.insert_element(element=line['actcse.31632'].copy(), index='bpv.21508_entry',
line.insert_element(element=line['actcse.31632'].copy(), index='bpv.21508',
name='cav2')
line.insert_element(element=line['actcse.31632'].copy(), index='bpv.41508_entry',
line.insert_element(element=line['actcse.31632'].copy(), index='bpv.41508',
name='cav4')
line.insert_element(element=line['actcse.31632'].copy(), index='bpv.51508_entry',
line.insert_element(element=line['actcse.31632'].copy(), index='bpv.51508',
name='cav5')
line.insert_element(element=line['actcse.31632'].copy(), index='bpv.61508_entry',
line.insert_element(element=line['actcse.31632'].copy(), index='bpv.61508',
name='cav6')

tt = line.get_table()
Expand Down Expand Up @@ -105,10 +105,10 @@
line.element_refs['mdv.53507'].ksl[0] = line.vars['mdv.53507.ksl0']

# Kill sextupoles in the bump
line.element_refs['lsf.53205..0'].knl[2] = 0
line.element_refs['lsd.53505..0'].knl[2] = 0
line.element_refs['lsf.53605..0'].knl[2] = 0
line.element_refs['lsd.60105..0'].knl[2] = 0
line.element_refs['lsf.53205'].k2l = 0
line.element_refs['lsd.53505'].k2l = 0
line.element_refs['lsf.53605'].k2l = 0
line.element_refs['lsd.60105'].k2l = 0

tw0 = line.twiss()
opt_bump = line.match(
Expand Down

0 comments on commit fbbf97b

Please sign in to comment.