Skip to content

Commit 93be6fb

Browse files
committed
More typing.
1 parent 6c42cfe commit 93be6fb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/pymatgen/core/structure.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def get_distance(self, i: int, j: int) -> float:
273273
raise NotImplementedError
274274

275275
@property
276-
def distance_matrix(self) -> np.ndarray:
276+
def distance_matrix(self) -> NDArray[np.float64]:
277277
"""The distance matrix between all sites in the structure. For
278278
periodic structures, this is overwritten to return the nearest image
279279
distance.
@@ -403,7 +403,7 @@ def num_sites(self) -> int:
403403
return len(self)
404404

405405
@property
406-
def cart_coords(self) -> np.ndarray:
406+
def cart_coords(self) -> NDArray[np.float64]:
407407
"""An np.array of the Cartesian coordinates of sites in the structure."""
408408
return np.array([site.coords for site in self])
409409

@@ -3889,9 +3889,9 @@ def get_boxed_structure(
38893889
offset = np.array([0, 0, 0])
38903890

38913891
coords = np.array(self.cart_coords)
3892-
x_range = max(coords[:, 0]) - min(coords[:, 0])
3893-
y_range = max(coords[:, 1]) - min(coords[:, 1])
3894-
z_range = max(coords[:, 2]) - min(coords[:, 2])
3892+
x_range = max(coords[:, 0]) - min(coords[:, 0]) # type:ignore[type-var]
3893+
y_range = max(coords[:, 1]) - min(coords[:, 1]) # type:ignore[type-var]
3894+
z_range = max(coords[:, 2]) - min(coords[:, 2]) # type:ignore[type-var]
38953895

38963896
if a <= x_range or b <= y_range or c <= z_range:
38973897
raise ValueError("Box is not big enough to contain Molecule.")

0 commit comments

Comments
 (0)