Skip to content

Commit

Permalink
fix: cell dectection for zero lattice length (#53)
Browse files Browse the repository at this point in the history
* fix: non-pbc handle

* fix: zero cell detect

* fix bugs

* fix: cell detect error when cell is negative

* fix bugs

---------

Co-authored-by: Xixian <v-xixianliu@microsoft.com>
  • Loading branch information
ZeroKnighting and Xixian authored Dec 5, 2024
1 parent eeb275c commit b6edd77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mattersim/datasets/utils/convertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def convert(
atoms.set_cell(lattice_matrix)
atoms.set_pbc(pbc_)
else:
if np.all(atoms.cell < 1e-5):
if np.all(abs(atoms.cell) < 1e-5):
raise ValueError("Cell vectors are too small")
else:
raise ValueError("structure type not supported")
Expand Down

0 comments on commit b6edd77

Please sign in to comment.