Skip to content

Commit 87adf12

Browse files
committed
Fix typo in cavity tracking; Remove the tolerance in ocelot comparison
1 parent 42dbebf commit 87adf12

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

cheetah/accelerator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ def _track_beam(self, incoming: ParticleBeam) -> ParticleBeam:
10071007
)
10081008

10091009
if isinstance(incoming, ParameterBeam):
1010-
outgoing_mu[4] = incoming._mu[4] + (
1010+
outgoing_mu[4] = outgoing_mu[4] + (
10111011
T566 * incoming._mu[5] ** 2
10121012
+ T556 * incoming._mu[4] * incoming._mu[5]
10131013
+ T555 * incoming._mu[4] ** 2
@@ -1024,7 +1024,7 @@ def _track_beam(self, incoming: ParticleBeam) -> ParticleBeam:
10241024
)
10251025
outgoing_cov[5, 4] = outgoing_cov[4, 5]
10261026
else: # ParticleBeam
1027-
outgoing_particles[:, 4] = incoming.particles[:, 4] + (
1027+
outgoing_particles[:, 4] = outgoing_particles[:, 4] + (
10281028
T566 * incoming.particles[:, 5] ** 2
10291029
+ T556 * incoming.particles[:, 4] * incoming.particles[:, 5]
10301030
+ T555 * incoming.particles[:, 4] ** 2

tests/test_compare_ocelot.py

-1
Original file line numberDiff line numberDiff line change
@@ -661,5 +661,4 @@ def test_cavity():
661661
assert np.allclose(
662662
outgoing_beam.particles[:, 4].cpu().numpy(),
663663
outgoing_parray.rparticles.transpose()[:, 4],
664-
atol=1e-4,
665664
)

0 commit comments

Comments
 (0)