Skip to content

Commit

Permalink
Added test cases for points_to_spheres in 2D and 3D. ! dtype=bool for…
Browse files Browse the repository at this point in the history
… im is still NOT TESTED !
  • Loading branch information
heinsimon committed Mar 13, 2024
1 parent 29f4984 commit 5487fe5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,18 @@ def test_tic_toc(self):
t = toc(quiet=True)
assert t > 1

def test_points_to_spheres_3D(self):
im=np.full((41,41,41),0)
im[20,20,20]=10
res_ps_3D=ps.tools.points_to_spheres(im=im)
assert np.sum(res_ps_3D) == 4169

def test_points_to_spheres_2D(self):
im=np.full((41,41),0)
im[20,20]=10
res_ps_2D=ps.tools.points_to_spheres(im=im)
assert np.sum(res_ps_2D) == 317


if __name__ == '__main__':
t = ToolsTest()
Expand Down

0 comments on commit 5487fe5

Please sign in to comment.