@@ -3787,7 +3787,7 @@ def get_distance(self, i: int, j: int) -> float:
3787
3787
"""
3788
3788
return self [i ].distance (self [j ])
3789
3789
3790
- def get_sites_in_sphere (self , pt : NDArray , r : float ) -> list [Neighbor ]:
3790
+ def get_sites_in_sphere (self , pt : ArrayLike , r : float ) -> list [Neighbor ]:
3791
3791
"""Find all sites within a sphere from a point.
3792
3792
3793
3793
Args:
@@ -3827,7 +3827,7 @@ def get_neighbors(self, site: Site, r: float) -> list[Neighbor]:
3827
3827
nns = self .get_sites_in_sphere (site .coords , r )
3828
3828
return [nn for nn in nns if nn != site ]
3829
3829
3830
- def get_neighbors_in_shell (self , origin : NDArray , r : float , dr : float ) -> list [Neighbor ]:
3830
+ def get_neighbors_in_shell (self , origin : ArrayLike , r : float , dr : float ) -> list [Neighbor ]:
3831
3831
"""Get all sites in a shell centered on origin (coords) between radii
3832
3832
r-dr and r+dr.
3833
3833
@@ -4136,9 +4136,9 @@ class Structure(IStructure, collections.abc.MutableSequence):
4136
4136
4137
4137
def __init__ (
4138
4138
self ,
4139
- lattice : NDArray | Lattice ,
4139
+ lattice : ArrayLike | Lattice ,
4140
4140
species : Sequence [CompositionLike ],
4141
- coords : Sequence [NDArray ] | NDArray ,
4141
+ coords : Sequence [ArrayLike ] | ArrayLike ,
4142
4142
charge : float | None = None ,
4143
4143
validate_proximity : bool = False ,
4144
4144
to_unit_cell : bool = False ,
@@ -4290,7 +4290,7 @@ def lattice(self, lattice: ArrayLike | Lattice) -> None:
4290
4290
def append ( # type:ignore[override]
4291
4291
self ,
4292
4292
species : CompositionLike ,
4293
- coords : NDArray ,
4293
+ coords : ArrayLike ,
4294
4294
coords_are_cartesian : bool = False ,
4295
4295
validate_proximity : bool = False ,
4296
4296
properties : dict | None = None ,
@@ -4322,7 +4322,7 @@ def insert( # type:ignore[override]
4322
4322
self ,
4323
4323
idx : int ,
4324
4324
species : CompositionLike ,
4325
- coords : NDArray ,
4325
+ coords : ArrayLike ,
4326
4326
coords_are_cartesian : bool = False ,
4327
4327
validate_proximity : bool = False ,
4328
4328
properties : dict | None = None ,
@@ -4360,7 +4360,7 @@ def replace(
4360
4360
self ,
4361
4361
idx : int ,
4362
4362
species : CompositionLike ,
4363
- coords : NDArray | None = None ,
4363
+ coords : ArrayLike | None = None ,
4364
4364
coords_are_cartesian : bool = False ,
4365
4365
properties : dict | None = None ,
4366
4366
label : str | None = None ,
@@ -4837,7 +4837,7 @@ def merge_sites(
4837
4837
if mode .lower ()[0 ] not in {"s" , "d" , "a" }:
4838
4838
raise ValueError (f"Illegal { mode = } , should start with a/d/s." )
4839
4839
4840
- dist_mat : NDArray = self .distance_matrix
4840
+ dist_mat : NDArray [ np . float64 ] = self .distance_matrix
4841
4841
np .fill_diagonal (dist_mat , 0 )
4842
4842
4843
4843
if dist_mat .shape == (1 , 1 ):
@@ -4849,7 +4849,7 @@ def merge_sites(
4849
4849
for cluster in np .unique (clusters ):
4850
4850
indexes = np .where (clusters == cluster )[0 ]
4851
4851
species : Composition = self [indexes [0 ]].species
4852
- coords : NDArray = self [indexes [0 ]].frac_coords
4852
+ coords : NDArray [ np . float64 ] = self [indexes [0 ]].frac_coords
4853
4853
props : dict = self [indexes [0 ]].properties
4854
4854
4855
4855
for site_idx , clust_idx in enumerate (indexes [1 :]):
@@ -5064,7 +5064,7 @@ class Molecule(IMolecule, collections.abc.MutableSequence):
5064
5064
def __init__ (
5065
5065
self ,
5066
5066
species : Sequence [SpeciesLike ],
5067
- coords : Sequence [NDArray ] | NDArray ,
5067
+ coords : Sequence [ArrayLike ] | ArrayLike ,
5068
5068
charge : float = 0.0 ,
5069
5069
spin_multiplicity : int | None = None ,
5070
5070
validate_proximity : bool = False ,
@@ -5163,7 +5163,7 @@ def __delitem__(self, idx: SupportsIndex | slice) -> None:
5163
5163
def append ( # type:ignore[override]
5164
5164
self ,
5165
5165
species : CompositionLike ,
5166
- coords : NDArray ,
5166
+ coords : ArrayLike ,
5167
5167
validate_proximity : bool = False ,
5168
5168
properties : dict | None = None ,
5169
5169
) -> Self :
@@ -5230,7 +5230,7 @@ def insert( # type:ignore[override]
5230
5230
self ,
5231
5231
idx : int ,
5232
5232
species : CompositionLike ,
5233
- coords : NDArray [ np . float64 ] ,
5233
+ coords : ArrayLike ,
5234
5234
validate_proximity : bool = False ,
5235
5235
properties : dict | None = None ,
5236
5236
label : str | None = None ,
0 commit comments