@@ -961,7 +961,7 @@ def get_angles(v1, v2, l1, l2):
961
961
for idx , all_j in enumerate (gamma_b ):
962
962
inds = np .logical_and (all_j [:, None ], np .logical_and (alpha_b , beta_b [idx ][None , :]))
963
963
for j , k in np .argwhere (inds ):
964
- scale_m = np .array ((f_a [idx ], f_b [j ], f_c [k ]), dtype = int ) # type: ignore[index]
964
+ scale_m = np .array ((f_a [idx ], f_b [j ], f_c [k ]), dtype = np . int64 ) # type: ignore[index]
965
965
if abs (np .linalg .det (scale_m )) < 1e-8 :
966
966
continue
967
967
@@ -1381,7 +1381,7 @@ def get_points_in_sphere(
1381
1381
frac_points = np .ascontiguousarray (frac_points , dtype = float )
1382
1382
latt_matrix = np .ascontiguousarray (self .matrix , dtype = float )
1383
1383
cart_coords = np .ascontiguousarray (self .get_cartesian_coords (frac_points ), dtype = float )
1384
- pbc = np .ascontiguousarray (self .pbc , dtype = int )
1384
+ pbc = np .ascontiguousarray (self .pbc , dtype = np . int64 )
1385
1385
center_coords = np .ascontiguousarray ([center ], dtype = float )
1386
1386
1387
1387
_ , indices , images , distances = find_points_in_spheres (
@@ -1510,12 +1510,12 @@ def get_points_in_sphere_old(
1510
1510
# Generate all possible images that could be within `r` of `center`
1511
1511
mins = np .floor (pcoords - nmax )
1512
1512
maxes = np .ceil (pcoords + nmax )
1513
- arange = np .arange (start = mins [0 ], stop = maxes [0 ], dtype = int )
1514
- brange = np .arange (start = mins [1 ], stop = maxes [1 ], dtype = int )
1515
- crange = np .arange (start = mins [2 ], stop = maxes [2 ], dtype = int )
1516
- arange = arange [:, None ] * np .array ([1 , 0 , 0 ], dtype = int )[None , :]
1517
- brange = brange [:, None ] * np .array ([0 , 1 , 0 ], dtype = int )[None , :]
1518
- crange = crange [:, None ] * np .array ([0 , 0 , 1 ], dtype = int )[None , :]
1513
+ arange = np .arange (start = mins [0 ], stop = maxes [0 ], dtype = np . int64 )
1514
+ brange = np .arange (start = mins [1 ], stop = maxes [1 ], dtype = np . int64 )
1515
+ crange = np .arange (start = mins [2 ], stop = maxes [2 ], dtype = np . int64 )
1516
+ arange = arange [:, None ] * np .array ([1 , 0 , 0 ], dtype = np . int64 )[None , :]
1517
+ brange = brange [:, None ] * np .array ([0 , 1 , 0 ], dtype = np . int64 )[None , :]
1518
+ crange = crange [:, None ] * np .array ([0 , 0 , 1 ], dtype = np . int64 )[None , :]
1519
1519
images = arange [:, None , None ] + brange [None , :, None ] + crange [None , None , :]
1520
1520
1521
1521
# Generate the coordinates of all atoms within these images
@@ -1629,7 +1629,7 @@ def get_distance_and_image(
1629
1629
if jimage is None :
1630
1630
v , d2 = pbc_shortest_vectors (self , frac_coords1 , frac_coords2 , return_d2 = True )
1631
1631
fc = self .get_fractional_coords (v [0 ][0 ]) + frac_coords1 - frac_coords2
1632
- fc = np .array (np .round (fc ), dtype = int )
1632
+ fc = np .array (np .round (fc ), dtype = np . int64 )
1633
1633
return np .sqrt (d2 [0 , 0 ]), fc
1634
1634
1635
1635
jimage = np .array (jimage )
@@ -1866,7 +1866,7 @@ def get_points_in_spheres(
1866
1866
neighbors : list [list [tuple [np .ndarray , float , int , np .ndarray ]]] = []
1867
1867
1868
1868
for ii , jj in zip (center_coords , site_neighbors , strict = True ):
1869
- l1 = np .array (_three_to_one (jj , ny , nz ), dtype = int ).ravel ()
1869
+ l1 = np .array (_three_to_one (jj , ny , nz ), dtype = np . int64 ).ravel ()
1870
1870
# Use the cube index map to find the all the neighboring
1871
1871
# coords, images, and indices
1872
1872
ks = [k for k in l1 if k in cube_to_coords ]
@@ -1905,7 +1905,7 @@ def _compute_cube_index(
1905
1905
Returns:
1906
1906
np.ndarray: nx3 array int indices
1907
1907
"""
1908
- return np .array (np .floor ((coords - global_min ) / radius ), dtype = int )
1908
+ return np .array (np .floor ((coords - global_min ) / radius ), dtype = np . int64 )
1909
1909
1910
1910
1911
1911
def _one_to_three (label1d : np .ndarray , ny : int , nz : int ) -> np .ndarray :
@@ -1943,7 +1943,7 @@ def find_neighbors(label: np.ndarray, nx: int, ny: int, nz: int) -> list[np.ndar
1943
1943
Neighbor cell indices.
1944
1944
"""
1945
1945
array = [[- 1 , 0 , 1 ]] * 3
1946
- neighbor_vectors = np .array (list (itertools .product (* array )), dtype = int )
1946
+ neighbor_vectors = np .array (list (itertools .product (* array )), dtype = np . int64 )
1947
1947
label3d = _one_to_three (label , ny , nz ) if np .shape (label )[1 ] == 1 else label
1948
1948
all_labels = label3d [:, None , :] - neighbor_vectors [None , :, :]
1949
1949
filtered_labels = []
0 commit comments