Skip to content

Commit

Permalink
Fix for GPU in test
Browse files Browse the repository at this point in the history
  • Loading branch information
giadarol committed Jun 6, 2023
1 parent 67afe21 commit 396b458
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_twiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,9 @@ def test_longitudinal_plane_against_matrix(machine, test_context):
p_matrix = xp.generate_matched_gaussian_bunch(num_particles=1000000,
nemitt_x=1e-6, nemitt_y=1e-6, sigma_z=5e-2, line=line_matrix, engine='linear')

p_line.move(_context=xo.context_default)
p_matrix.move(_context=xo.context_default)

assert np.isclose(np.std(p_line.zeta), np.std(p_matrix.zeta), rtol=1e-2)
assert np.isclose(np.std(p_line.pzeta), np.std(p_matrix.pzeta), rtol=2e-2)
assert np.isclose(np.std(p_line.x), np.std(p_matrix.x), rtol=1e-2)
Expand Down

0 comments on commit 396b458

Please sign in to comment.