From 715df97fdc67f699143f04d072a4810f6aa37a51 Mon Sep 17 00:00:00 2001 From: Eliza Neights Date: Thu, 24 Oct 2024 11:59:28 -0700 Subject: [PATCH] Increase tolerance to compare fit values --- tests/polarization/test_polarization_asad.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/polarization/test_polarization_asad.py b/tests/polarization/test_polarization_asad.py index 488f0993..737f9118 100644 --- a/tests/polarization/test_polarization_asad.py +++ b/tests/polarization/test_polarization_asad.py @@ -51,7 +51,7 @@ def test_convolve_spectrum(): assert polarization._expectation.unit.is_equivalent('keV') - assert np.allclose(polarization._expectation.project('Em').contents[0], 7657.331992884072) + assert np.allclose(polarization._expectation.project('Em').contents[0], 7657.331992884072, atol=5.0) assert np.allclose([polarization._azimuthal_angle_bins[5].rad, polarization._azimuthal_angle_bins[12].rad, polarization._azimuthal_angle_bins[25].rad, polarization._azimuthal_angle_bins[40].rad], @@ -152,7 +152,7 @@ def test_polarization_fit(): mu_100 = polarization.calculate_mu100(asad_polarized, asad_unpolarized) assert np.allclose([mu_100['mu'], mu_100['uncertainty']], - [0.02068036893603115, 9.3940548992881e-07]) + [0.02068036893603115, 9.3940548992881e-07], atol=[0.01, 1e-7]) asad_corrected = polarization.correct_asad(asad, asad_unpolarized) @@ -167,4 +167,4 @@ def test_polarization_fit(): assert np.allclose([polarization_fit['fraction'], polarization_fit['fraction uncertainty'], polarization_fit['angle'].angle.rad, polarization_fit['angle uncertainty'].rad], - [15.270059610935844, 2.3931615504423474, 1.53994098472832, 0.07217196641713962]) \ No newline at end of file + [15.270059610935844, 2.3931615504423474, 1.53994098472832, 0.07217196641713962], atol=[1.0, 0.5, 1.0, 0.1]) \ No newline at end of file