Skip to content

Commit

Permalink
allow for arbitrary box shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Schaefer committed Apr 3, 2024
1 parent d601e98 commit 1e75155
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apax/utils/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ def atoms_to_inputs(
}

box = atoms_list[0].cell.array
pbc = np.all(box > 1e-6)
pbc = np.any(np.abs(box) > 1e-6)

for atoms in atoms_list:
box = (atoms.cell.array * unit_dict[pos_unit]).astype(DTYPE)
box = box.T # takes row and column convention of ase into account
inputs["box"].append(box)

if pbc != np.all(box > 1e-6):
if pbc != np.any(np.abs(box) > 1e-6):
raise ValueError(
"Apax does not support dataset periodic and non periodic structures"
)

if np.all(box < 1e-6):
if np.all(np.abs(box) < 1e-6):
inputs["positions"].append(
(atoms.positions * unit_dict[pos_unit]).astype(DTYPE)
)
Expand Down

0 comments on commit 1e75155

Please sign in to comment.