File: test_get_angles.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (14 lines) | stat: -rw-r--r-- 420 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def test_get_angles():
    from ase.build import graphene_nanoribbon
    import numpy as np

    g = graphene_nanoribbon(3, 2, type="zigzag", vacuum=5)

    test_set = [[0, 1, x] for x in range(2, len(g))]

    manual_results = [g.get_angle(a1, a2, a3, mic=True) 
                      for a1, a2, a3 in test_set]

    set_results = g.get_angles(test_set, mic=True)

    assert(np.allclose(manual_results, set_results))