Skip to content

Commit 3d87e57

Browse files
authored
bug: fix no raise RuntimeError (#3748)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved error handling in the neighbor list building process to provide clearer error messages when atom distances are too close. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 2438177 commit 3d87e57

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

deepmd/pt/utils/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def build_neighbor_list(
185185
distance[:nloc, :nloc] += torch.eye(nloc, dtype=torch.bool) * DISTANCE_INF
186186
if min_check:
187187
if distance.min().abs() < 1e-6:
188-
RuntimeError("Atom dist too close!")
188+
raise RuntimeError("Atom dist too close!")
189189
if not type_split:
190190
sec = sec[-1:]
191191
lst = []

0 commit comments

Comments
 (0)