Skip to content

Commit c5708f1

Browse files
committed
test vibrational entropy
1 parent ab9f853 commit c5708f1

4 files changed

Lines changed: 25 additions & 2 deletions

File tree

CodeEntropy/tests/test_EntropyFunctions/test_frequency_calculation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def test_frequency_calculation_0():
1515
assert frequencies == 0
1616

1717
# test when lambdas are positive
18+
# the data for this test came from running CodeEntropy0.3 at the whole molecule level with 1AKI_ws.tpr and 1AKI_ws.trr from the CodeEntropy0.3/Examples
1819
def test_frequency_calculation_pos():
1920
lambdas = numpy.array([585495.0917897299, 658074.5130064893, 782425.305888707])
2021
temp = 298

CodeEntropy/tests/test_EntropyFunctions/test_vibrational_entropy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Given a matrix does the code calculate the correct entropy value
77

88
# test for matrix_type force, highest level=yes
9+
# the data for this test came from running CodeEntropy0.3 at the whole molecule level with 1AKI_ws.tpr and 1AKI_ws.trr from the CodeEntropy0.3/Examples
910
def test_vibrational_entropy_polymer_force():
1011
matrix = numpy.array([[4.67476, -0.04069, -0.19714],[-0.04069, 3.86300, -0.17922],[-0.19714, -0.17922, 3.66307]])
1112
matrix_type = "force"
@@ -19,6 +20,7 @@ def test_vibrational_entropy_polymer_force():
1920
# test for matrix_type force, highest level=no
2021

2122
# test for matrix_type torque
23+
# the data for this test came from running CodeEntropy0.3 at the whole molecule level with 1AKI_ws.tpr and 1AKI_ws.trr from the CodeEntropy0.3/Examples
2224
def test_vibrational_entropy_polymer_torque():
2325
matrix = numpy.array([[6.69611, 0.39754, 0.57763],[0.39754, 4.63265, 0.38648],[0.57763, 0.38648, 6.34589]])
2426
matrix_type = "torque"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import pytest
2+
import numpy
3+
from CodeEntropy import GeometricFunctions as GF
4+
5+
## Test get_sphCoord_axes
6+
# Given a vector does the code calculate the correct spherical basis to use as rotational axes
7+
8+
# The data for this test comes from running CodeEntropy0.3 at the united atom level with 1AKI_ws.tpr and 1AKI_ws.trr from the CodeEntropy0.3/Examples
9+
# Using the value from the first bead in the first frame
10+
def test_get_sphCoord_axes():
11+
arg_r = [-0.1240921, 0.2787145, -0.0764211] # input vector
12+
13+
spherical_basis = GF.get_sphCoord_axes(arg_r)
14+
15+
ref = [[-0.39454843, 0.88616733, -0.24297941],[0.0988289, -0.22197261, -0.97003145],[-0.91354496, -0.40673777, 0.0]]
16+
17+
assert spherical_basis[0] == pytest.approx(ref[0])
18+
assert spherical_basis[1] == pytest.approx(ref[1])
19+
assert spherical_basis[2] == pytest.approx(ref[2])
20+
21+
# TODO test for error handling on invalid inputs
22+

CodeEntropy/tests/test_main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
# Import package, test suite, and other packages as needed
66
import sys
7-
87
import pytest
9-
108
import CodeEntropy
119

1210

0 commit comments

Comments
 (0)