-
Notifications
You must be signed in to change notification settings - Fork 16
/
test_q12.py
32 lines (25 loc) · 1.01 KB
/
test_q12.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import pytest
import os
import numpy as np
import pyscal.core as pc
from pyscal.crystal_structures import Structure
def test_q_12():
sys = Structure().lattice.fcc(repetitions = [4, 4, 4])
#sys.get_neighbors(method = 'voronoi')
sys.find_neighbors(method = 'cutoff', cutoff=0.9)
q = sys.calculate_q(12)
assert np.round(np.mean(np.array(q)), decimals=2) == 0.60 , "Calculated q4 value is wrong!"
q = sys.calculate_q(12, averaged=True)
assert np.round(np.mean(np.array(q)), decimals=2) == 0.60 , "Calculated q4 value is wrong!"
"""
def test_q_12_voro():
atoms, boxdims = pcs.make_crystal('fcc', repetitions = [4, 4, 4])
sys = pc.System()
sys.box = boxdims
sys.atoms = atoms
sys.find_neighbors(method = 'voronoi')
q = sys.calculate_q(12)
assert np.round(np.mean(np.array(q)), decimals=2) == 0.60 , "Calculated q4 value is wrong!"
q = sys.calculate_q(12, averaged=True)
assert np.round(np.mean(np.array(q)), decimals=2) == 0.60 , "Calculated q4 value is wrong!"
"""