Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jank324 committed Sep 11, 2023
1 parent eddbb03 commit 5d1782c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 42 deletions.
16 changes: 8 additions & 8 deletions cheetah/accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,14 +915,14 @@ def _track_beam(self, incoming: ParticleBeam) -> ParticleBeam:
+ T555 * incoming.particles[:, 4] ** 2
)

if isinstance(incoming, ParameterBeam):
outgoing = ParameterBeam(outgoing_mu, outgoing_cov, outgoing_energy)
return outgoing
else: # ParticleBeam
outgoing = ParticleBeam(
outgoing_particles, outgoing_energy, device=incoming.device
)
return outgoing
if isinstance(incoming, ParameterBeam):
outgoing = ParameterBeam(outgoing_mu, outgoing_cov, outgoing_energy)
return outgoing
else: # ParticleBeam
outgoing = ParticleBeam(
outgoing_particles, outgoing_energy, device=incoming.device
)
return outgoing

def _cavity_rmatrix(self, energy: float) -> torch.Tensor:
"""Produces an R-matrix for a cavity when it is on, i.e. voltage > 0.0."""
Expand Down
72 changes: 38 additions & 34 deletions test_bmad.ipynb

Large diffs are not rendered by default.

0 comments on commit 5d1782c

Please sign in to comment.