From fbde274d0896d93494b36d18a56d90c42142e6be Mon Sep 17 00:00:00 2001 From: pattonw Date: Mon, 17 Apr 2023 22:16:15 -0400 Subject: [PATCH] fix shift_augment test test_pipeline2: Shift augment may increase the request roi, thus making a request at the boundary of the provided roi may fail. test_pipeline3: With a request size of 60 and a total roi of 100, this leaves us 40 voxels of space for jitter. If `max(jitter) - min(jitter)` is greater than 8 sigma this test fails. Dropping sigma to 4 means we have a lower chance of failing this test --- tests/cases/shift_augment.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/cases/shift_augment.py b/tests/cases/shift_augment.py index dd954555..45c77806 100644 --- a/tests/cases/shift_augment.py +++ b/tests/cases/shift_augment.py @@ -122,7 +122,9 @@ def test_pipeline2(self): request = BatchRequest() shape = Coordinate((3, 3)) - request.add(key, shape, voxel_size=Coordinate((3, 1))) + request[key] = ArraySpec( + roi=Roi((9, 9), shape), voxel_size=Coordinate((3, 1)) + ) shift_node = ShiftAugment(prob_slip=0.2, prob_shift=0.2, sigma=1, shift_axis=0) with build((hdf5_source + shift_node)) as b: @@ -148,7 +150,7 @@ def test_pipeline3(self): request.add(array_key, shape, voxel_size=Coordinate((1, 1))) request.add(points_key, shape) - shift_node = ShiftAugment(prob_slip=0.2, prob_shift=0.2, sigma=5, shift_axis=0) + shift_node = ShiftAugment(prob_slip=0.2, prob_shift=0.2, sigma=4, shift_axis=0) pipeline = ( (hdf5_source, csv_source) + MergeProvider()