Skip to content

Commit

Permalink
Update test_STC.py
Browse files Browse the repository at this point in the history
  • Loading branch information
huixingjian authored Dec 17, 2024
1 parent e2d7ad0 commit d433e6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_STC.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,16 @@
)
env_combined = laser_2d_combined.grid.get_temporal_field()
env_gaussian = laser_2d_gaussian.grid.get_temporal_field()
err_real = np.average(np.array(env_combined.real) - np.array(env_gaussian.real))
err_real = np.average((np.array(env_combined.real) - np.array(env_gaussian.real))/(np.array(env_combined.real))

Check failure

Code scanning / CodeQL

Syntax error Error test

Syntax Error (in Python 3).
err_imag = np.average(np.array(env_combined.imag) - np.array(env_gaussian.imag)/(np.array(env_combined.imag))

Phi2_3d, phi2_3d = get_phi2(laser_3d.dim, laser_3d.grid)

[zeta_x, zeta_y], [nu_x, nu_y] = get_zeta(
laser_3d.dim, laser_3d.grid, 2.0 * np.pi / 0.6e-6
)
[beta_x, beta_y] = get_beta(laser_3d.dim, laser_3d.grid, 2.0 * np.pi / 0.6e-6)
np.testing.assert_approx_equal(err_real, 1e-3, significant=1)
assert (err_real+err_imag)<1e-6
np.testing.assert_approx_equal(phi2_3d, 2.4e-24, significant=2)
np.testing.assert_approx_equal(zeta_y, 2.4e-22, significant=2)
np.testing.assert_approx_equal(beta_y, 3e-18, significant=2)

0 comments on commit d433e6a

Please sign in to comment.