File: test_cutoffs.py

package info (click to toggle)
python-ase 3.26.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (16 lines) | stat: -rw-r--r-- 488 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# fmt: off
import numpy as np

from ase import Atoms
from ase.neighborlist import natural_cutoffs


def test_cutoffs():
    atoms = Atoms("HCOPtAu")

    assert np.allclose(natural_cutoffs(atoms),
                       [0.31, 0.76, 0.66, 1.36, 1.36])
    assert np.allclose(natural_cutoffs(atoms, mult=1.2),
                       [0.372, 0.912, 0.792, 1.632, 1.632])
    assert np.allclose(natural_cutoffs(atoms, mult=1.2, Au=1),
                       [0.372, 0.912, 0.792, 1.632, 1])