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 Dec 17, 2024
1 parent 2ad2097 commit 2b5eb39
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_STC.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,22 @@
)
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))/np.array(env_combined.real))
err_imag = np.average(np.array(env_combined.imag) - np.array(env_gaussian.imag)/np.array(env_combined.imag))
err_real = np.average(
(np.array(env_combined.real) - np.array(env_gaussian.real))
/ np.array(env_combined.real)
)
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)

Check notice

Code scanning / CodeQL

Unused global variable Note test

The global variable 'beta_x' is not used.
assert (err_real+err_imag)<1e-6
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 2b5eb39

Please sign in to comment.