Skip to content

Commit

Permalink
Merge pull request #834 from ComputationalCryoEM/patch_flaky_utest_again
Browse files Browse the repository at this point in the history
Update randomized unit test that was flaky after running large trial
  • Loading branch information
garrettwrong authored Jan 9, 2023
2 parents de78829 + ac349d8 commit 1554bbb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from aspire.noise import CustomNoiseAdder, WhiteNoiseAdder, WhiteNoiseEstimator
from aspire.operators import FunctionFilter, ScalarFilter
from aspire.source.simulation import Simulation
from aspire.utils import utest_tolerance
from aspire.volume import AsymmetricVolume

DATA_DIR = os.path.join(os.path.dirname(__file__), "saved_test_data")
Expand Down Expand Up @@ -62,7 +61,12 @@ def test_white_noise_estimator_clean_corners(sim_fixture):
noise_variance = noise_estimator.estimate()
# Using a compactly supported volume should yield
# virtually no noise in the image corners.
assert np.isclose(noise_variance, 0, atol=utest_tolerance(sim_fixture.dtype))
assert np.isclose(noise_variance, 0, atol=1e-6)
# 1e-6 was chosen by running the unit test suite 10k (x4 fixture expansion) times.
# min=7.544584748608862e-12 max=1.6798412007391812e-07
# mean=1.0901885456753326e-09 var=5.27460957578949e-18
# To reduce the randomness would require a increasing simulation `n`
# and/or increasing resolution. Both would increase test time.


def test_adder_reprs(adder):
Expand Down

0 comments on commit 1554bbb

Please sign in to comment.