Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFP committed Oct 17, 2023
1 parent 025acfe commit f35cb38
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/test_active_plasma_lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_active_plasma_lens():
apl.track(bunch)
bunch_params = analyze_bunch(bunch)
gamma_x = bunch_params['gamma_x']
assert approx(gamma_x, rel=1e-10) == 92.14017315271572
assert approx(gamma_x, rel=1e-10) == 92.38646379897074


def test_active_plasma_lens_with_wakefields():
Expand Down Expand Up @@ -64,7 +64,7 @@ def test_active_plasma_lens_with_wakefields():
# Analyze and check results.
bunch_params = analyze_bunch(bunch)
gamma_x = bunch_params['gamma_x']
assert approx(gamma_x, rel=1e-10) == 77.32004939154773
assert approx(gamma_x, rel=1e-10) == 77.31995824746237


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion tests/test_field_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_field_element_tracking():
# Check that results have not changed.
bunch_params = analyze_bunch(bunch)
beta_x = bunch_params['beta_x']
assert approx(beta_x, rel=1e-10) == 0.054508554263608434
assert approx(beta_x, rel=1e-10) == 0.05450127309723603


def test_field_element_error():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fluid_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_fluid_model(plot=False):

# Check final parameters.
ene_sp = params_evolution['rel_ene_spread'][-1]
assert approx(ene_sp, rel=1e-10) == 0.024183646993930535
assert approx(ene_sp, rel=1e-10) == 0.024179998095119972

# Quick plot of results.
if plot:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_multibunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def test_multibunch_plasma_simulation(plot=False):
# Assert final parameters are correct.
final_energy_driver = driver_params['avg_ene'][-1]
final_energy_witness = witness_params['avg_ene'][-1]
assert approx(final_energy_driver, rel=1e-10) == 1700.33213311266
assert approx(final_energy_witness, rel=1e-10) == 636.3355022503769
assert approx(final_energy_driver, rel=1e-10) == 1700.3927190416732
assert approx(final_energy_witness, rel=1e-10) == 636.330857261392

if plot:
z = driver_params['prop_dist'] * 1e2
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ramps.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_downramp():
downramp.track(bunch)
bunch_params = analyze_bunch(bunch)
beta_x = bunch_params['beta_x']
assert beta_x == 0.009757682933057094
assert beta_x == 0.009750309290619276


def test_upramp():
Expand Down Expand Up @@ -64,7 +64,7 @@ def test_upramp():
downramp.track(bunch)
bunch_params = analyze_bunch(bunch)
beta_x = bunch_params['beta_x']
assert beta_x == 0.0007641796148894145
assert beta_x == 0.0007631600676104024


if __name__ == '__main__':
Expand Down

0 comments on commit f35cb38

Please sign in to comment.