Skip to content

Commit

Permalink
relax tolerance a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
grlee77 committed Mar 4, 2025
1 parent bcd94fb commit a641856
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions python/cucim/src/cucim/skimage/measure/tests/test_regionprops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
import cupyx.scipy.ndimage as ndi
import numpy as np
import pytest
from cupy.testing import assert_array_almost_equal, assert_array_equal
from cupy.testing import (
assert_allclose,
assert_array_almost_equal,
assert_array_equal,
)
from numpy.testing import assert_almost_equal, assert_equal
from skimage import data, draw
from skimage.segmentation import slic
Expand Down Expand Up @@ -1252,7 +1256,9 @@ def test_regionprops_table_batch_close_to_original():
elif prop == "slice":
assert_array_equal(rp, out_table[prop][i])
else:
assert_array_almost_equal(rp, out_table[prop][i])
assert_allclose(
rp, out_table[prop][i], atol=1e-5, rtol=1e-5
)
else:
shape = rp.shape if isinstance(rp, cp.ndarray) else (len(rp),)
if "moments" in prop:
Expand All @@ -1262,8 +1268,11 @@ def test_regionprops_table_batch_close_to_original():
for ind in np.ndindex(shape):
modified_prop = "-".join(map(str, (prop,) + ind))
loc = ind if len(ind) > 1 else ind[0]
assert_array_almost_equal(
rp[loc], out_table[modified_prop][i]
assert_allclose(
rp[loc],
out_table[modified_prop][i],
atol=1e-5,
rtol=1e-5,
)


Expand Down

0 comments on commit a641856

Please sign in to comment.