Skip to content

Commit

Permalink
Merge pull request uibcdf#16 from casuarioq/jc_proposal_remove_methods
Browse files Browse the repository at this point in the history
Propousal for testing the recent removing methods
  • Loading branch information
dprada authored Aug 25, 2022
2 parents cdeb6df + 786a404 commit 43e6ceb
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions openpocket/tests/test_alphaspheres.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,52 @@ def test_alphaspheres_original_points():

assert alphaspheres.n_points == 6

assert alphaspheres.n_alpha_spheres == 4

centers = ([[ 6.5 , 1.5 , -0.5 ],
[-0.25, -0.75, 1.75],
[ 0.5 , 1.5 , -0.5 ],
[-1.5 , 0.5 , 0.5 ]])

assert np.allclose(centers, alphaspheres.centers)

radius_all = ([6.68954408, 1.92028644, 1.6583124 , 1.6583124 ])

assert np.allclose(radius_all, alphaspheres.radii)

points_of_alpha_sphere = ([[1, 2, 3, 4],
[2, 3, 4, 5],
[0, 1, 3, 4],
[0, 3, 4, 5]])

assert np.allclose(points_of_alpha_sphere, alphaspheres.points_of_alpha_sphere)

merged_selected_point_indices = [0, 2, 3, 4, 5]

assert np.allclose(merged_selected_point_indices, alphaspheres.get_points_of_alpha_spheres([1,3]))

alphaspheres.remove_big_alpha_spheres(5.0)

assert alphaspheres.n_alpha_spheres == 3

remaining_no_big_raidus = ([1.92028644, 1.6583124 , 1.6583124 ])

assert np.allclose(remaining_no_big_raidus, alphaspheres.radii)

remaining_no_big_centers = ([[-0.25, -0.75, 1.75],
[ 0.5 , 1.5 , -0.5 ],
[-1.5 , 0.5 , 0.5 ]])

assert np.allclose(remaining_no_big_centers, alphaspheres.centers)

alphaspheres.remove_small_alpha_spheres(1.66)

assert alphaspheres.n_alpha_spheres == 1

remaining_no_small_raidus = ([1.92028644])

assert np.allclose(remaining_no_small_raidus, alphaspheres.radii)

remaining_no_small_centers= ([[-0.25, -0.75, 1.75]])

assert np.allclose(remaining_no_small_centers, alphaspheres.centers)

0 comments on commit 43e6ceb

Please sign in to comment.