Skip to content

Commit

Permalink
Increase tolerance to avoid sporadic test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jank324 committed Sep 14, 2023
1 parent 73e027b commit 164be26
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_particle_beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ def test_from_twiss_to_twiss():
energy=torch.tensor(6e6),
)
# rather loose rtol is needed here due to the random sampling of the beam
assert np.isclose(beam.beta_x, 5.91253676811640894, rtol=1e-3)
assert np.isclose(beam.alpha_x, 3.55631307633660354, rtol=1e-3)
assert np.isclose(beam.emittance_x, 3.494768647122823e-09, rtol=1e-3)
assert np.isclose(beam.beta_y, 5.91253676811640982, rtol=1e-3)
assert np.isclose(beam.alpha_y, 1.0, rtol=1e-3)
assert np.isclose(beam.emittance_y, 3.497810737006068e-09, rtol=1e-3)
assert np.isclose(beam.beta_x, 5.91253676811640894, rtol=1e-2)
assert np.isclose(beam.alpha_x, 3.55631307633660354, rtol=1e-2)
assert np.isclose(beam.emittance_x, 3.494768647122823e-09, rtol=1e-2)
assert np.isclose(beam.beta_y, 5.91253676811640982, rtol=1e-2)
assert np.isclose(beam.alpha_y, 1.0, rtol=1e-2)
assert np.isclose(beam.emittance_y, 3.497810737006068e-09, rtol=1e-2)
assert np.isclose(beam.energy, 6e6)

0 comments on commit 164be26

Please sign in to comment.