Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 17, 2025
1 parent aa075bc commit 3f7a561
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions examples/iota_lens/analysis_iotalens_sdep_aperture.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def get_moments(beam):
1.020826e-04,
2.868312e-06,
3.163618e-06,
5.400000e+00,
5.400000e00,
],
rtol=rtol,
atol=atol,
Expand All @@ -101,17 +101,14 @@ def get_moments(beam):
charge_i = initial_beam.get_attribute("charge_C")
charge_f = final_beam.get_attribute("charge_C")

loss_pct = 100.0*(charge_i - charge_f)/charge_i
loss_pct = 100.0 * (charge_i - charge_f) / charge_i

print(f" fractional loss (%) = {loss_pct}")

atol = 0.2 # tolerance 0.2%
print(f" atol={atol}")
assert np.allclose(
[loss_pct],
[
6.0824
],
[6.0824],
atol=atol,
)

0 comments on commit 3f7a561

Please sign in to comment.