Skip to content

Commit edb072b

Browse files
committed
adding first tests
1 parent 328fb3e commit edb072b

7 files changed

Lines changed: 71 additions & 837 deletions

File tree

CodeEntropy/tests/test_CodeEntropy.py

Lines changed: 0 additions & 350 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import pytest
2+
import numpy
3+
from CodeEntropy import EntropyFunctions as EF
4+
5+
## Test conformational_entropy
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import pytest
2+
import numpy
3+
from CodeEntropy import EntropyFunctions as EF
4+
5+
## Test frequency_calculation (calculate vibrational frequencies from eigenvalues of covariance matrix)
6+
# Given lambda value(s) do you get the correct frequency
7+
8+
# test when lambda is zero
9+
def test_frequency_calculation_0():
10+
lambdas = 0
11+
temp = 298
12+
13+
frequencies = EF.frequency_calculation(lambdas, temp)
14+
15+
assert frequencies == 0
16+
17+
# test when lambdas are positive
18+
def test_frequency_calculation_pos():
19+
lambdas = numpy.array([585495.0917897299, 658074.5130064893, 782425.305888707])
20+
temp = 298
21+
22+
frequencies = EF.frequency_calculation(lambdas, temp)
23+
24+
assert frequencies == pytest.approx([1899594266400.4016, 2013894687315.6213, 2195940987139.7097])
25+
26+
# TODO test for error handling when lambdas are negative
27+
28+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import pytest
2+
import numpy
3+
from CodeEntropy import EntropyFunctions as EF
4+
5+
## Test orientational_entropy

0 commit comments

Comments
 (0)