From 2b5eb39053a7700a9f5e3833c276f0f0a094e3ff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:24:36 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_STC.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_STC.py b/tests/test_STC.py index 344cab01..ce475d0c 100644 --- a/tests/test_STC.py +++ b/tests/test_STC.py @@ -82,8 +82,14 @@ ) 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) @@ -91,7 +97,7 @@ 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) -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)