diff --git a/tests/test_commonline_utils.py b/tests/test_commonline_utils.py index bcced630a1..669d33ca01 100644 --- a/tests/test_commonline_utils.py +++ b/tests/test_commonline_utils.py @@ -98,8 +98,11 @@ def test_J_sync(dtype): Rijs_conjugated[ij] = Rij ij += 1 - # Initialize JSync instance with default params. - J_sync = JSync(n) + # Initialize JSync instance. + # For this small problem, set epsilon to 1e-3 (default is 1e-2) + # to prevent premature power method stoppage due to residual + # dipping below epsilon on a single early iteration. + J_sync = JSync(n, epsilon=1e-3) # Perform power method and check that signs are correct up to # multilication by -1. Also check dtype pass-through. diff --git a/tests/test_oriented_source.py b/tests/test_oriented_source.py index 30bb080b9f..0fa10d6c8e 100644 --- a/tests/test_oriented_source.py +++ b/tests/test_oriented_source.py @@ -31,7 +31,7 @@ def src_fixture_id(params): @pytest.fixture(params=ESTIMATOR_SYMMETRY, ids=src_fixture_id) def src_fixture(request): estimator, symmetry = request.param - L = 8 + L = 12 # Must be greater than 8 for Cn algos. n = 10 vol = None @@ -43,7 +43,7 @@ def src_fixture(request): estimator_kwargs.update({"n_theta": 36, "symmetry": symmetry}) # Generate an origianl source and an oriented source. - og_src = Simulation(L=L, n=n, vols=vol, offsets=0) + og_src = Simulation(L=L, n=n, vols=vol, C=1, offsets=0, seed=0) orient_est = estimator(og_src, max_shift=1 / L, mask=False, **estimator_kwargs) oriented_src = OrientedSource(og_src, orient_est) @@ -138,7 +138,7 @@ def test_save(src_fixture, save_mode): Test save function and save_mode. """ - src = src_fixture[1] + src = src_fixture[1].cache() # Make a fresh tmp_dir with tempfile.TemporaryDirectory() as tmp_dir: