Skip to content

Commit

Permalink
compare to original offsets.
Browse files Browse the repository at this point in the history
  • Loading branch information
j-c-c committed Oct 18, 2024
1 parent 126f070 commit c8a51b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_downsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def test_downsample_offsets(dtype, res):
n = 10
ds_scale = 2

offsets = np.random.choice([L // 8, -L // 8], size=(n, 2))
offsets = np.random.choice([L // 8, -L // 8], size=(n, 2)).astype(dtype, copy=False)
src = Simulation(
L=L,
n=n,
Expand All @@ -240,8 +240,8 @@ def test_downsample_offsets(dtype, res):

# Check `offsets` and `sim_offsets` attributes are as expected, ie.
# `sim_offsets` are same as original while `offsets` are scaled by downsample.
np.testing.assert_array_equal(src_ds.sim_offsets, src.offsets)
np.testing.assert_array_equal(src_ds.offsets, src.offsets / offset_scale)
np.testing.assert_array_equal(src_ds.sim_offsets, offsets)
np.testing.assert_array_equal(src_ds.offsets, offsets / offset_scale)

# Check that centering works for original and downsampled images.
np.testing.assert_allclose(
Expand Down

0 comments on commit c8a51b8

Please sign in to comment.