Remove lines supporting old numpy versions

This commit is contained in:
Atsushi Togo 2022-03-17 17:40:51 +09:00
parent 671990838d
commit 88d9c4c93e
1 changed files with 3 additions and 14 deletions

View File

@ -1201,20 +1201,9 @@ class ShortestPairs:
)
bases = [[1, 0, 0], [0, 1, 0], [0, 0, 1], [-1, -1, -1]]
lattice_points = np.dot(lattice_4D, bases)
if StrictVersion(np.__version__) >= StrictVersion("1.13.0"):
lattice_points = np.array(
np.unique(lattice_points, axis=0), dtype=int_dtype, order="C"
)
else:
unique_indices = np.unique(
[
np.nonzero(np.abs(lattice_points - point).sum(axis=1) == 0)[0][0]
for point in lattice_points
]
)
lattice_points = np.array(
lattice_points[unique_indices], dtype=int_dtype, order="C"
)
lattice_points = np.array(
np.unique(lattice_points, axis=0), dtype=int_dtype, order="C"
)
return (
lattice_points,