Skip to content

Commit

Permalink
update: generalize for supercells
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Aug 22, 2024
1 parent bd34d44 commit ac7a67b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/py/mat3ra/made/tools/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ def get_undercoordinated_atom_indices(
coordinates = np.array(material.basis.coordinates.values)
neighbors_indices_array = []
neighbors_numbers = []
undercoordinated_atom_indices: List[int] = []

for idx in indices_to_check:
coordinate = coordinates[idx]
Expand All @@ -395,6 +394,8 @@ def get_undercoordinated_atom_indices(
neighbors_numbers = np.array(neighbors_numbers) # type: ignore
threshold = np.max(neighbors_numbers)

undercoordinated_atom_indices = np.where(neighbors_numbers < threshold)[0].tolist()
undercoordinated_atom_indices = [
idx for idx, num_neighbors in zip(indices_to_check, neighbors_numbers) if num_neighbors < threshold
]

return undercoordinated_atom_indices, neighbors_indices_array

0 comments on commit ac7a67b

Please sign in to comment.