Skip to content

Commit

Permalink
fix shift_augment test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pattonw committed Apr 18, 2023
1 parent c033463 commit fbde274
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/cases/shift_augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
Expand Down

0 comments on commit fbde274

Please sign in to comment.