From 35ce62e4f550609a3279f136a39a6d002fc5dd46 Mon Sep 17 00:00:00 2001 From: Garrett Wright Date: Mon, 15 Jul 2024 09:41:35 -0400 Subject: [PATCH] use utest_tolerance for single precision run to run variability --- tests/test_covar2d_denoiser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_covar2d_denoiser.py b/tests/test_covar2d_denoiser.py index a403a72109..7b4da5511e 100644 --- a/tests/test_covar2d_denoiser.py +++ b/tests/test_covar2d_denoiser.py @@ -6,6 +6,7 @@ from aspire.noise import WhiteNoiseAdder from aspire.operators import IdentityFilter, RadialCTFFilter from aspire.source import Simulation +from aspire.utils import utest_tolerance # TODO, parameterize these further. dtype = np.float32 @@ -89,7 +90,9 @@ def test_batched_rotcov2d_MSE(sim, basis): # Additionally test the `DenoisedSource` and lazy-eval-cache # of the cov2d estimator. src = DenoisedSource(sim, denoiser) - np.testing.assert_allclose(imgs_denoised, src.images[:], rtol=1e-05, atol=1e-08) + np.testing.assert_allclose( + imgs_denoised, src.images[:], rtol=1e-05, atol=utest_tolerance(src.dtype) + ) def test_source_mismatch(sim, basis):