|
2 | 2 |
|
3 | 3 | from CodeEntropy.entropy.orientational import OrientationalEntropy |
4 | 4 |
|
| 5 | +_GAS_CONST: float = 8.3144598484848 |
| 6 | + |
5 | 7 |
|
6 | 8 | def test_orientational_negative_count_raises(): |
7 | | - oe = OrientationalEntropy(None, None, None, None, None) |
| 9 | + oe = OrientationalEntropy(_GAS_CONST) |
8 | 10 | with pytest.raises(ValueError): |
9 | 11 | oe.calculate_orientational(-1, 1, False) |
10 | 12 |
|
11 | 13 |
|
12 | 14 | def test_orientational_zero_count_contributes_zero(): |
13 | | - oe = OrientationalEntropy(None, None, None, None, None) |
| 15 | + oe = OrientationalEntropy(_GAS_CONST) |
14 | 16 | assert oe.calculate_orientational(0, 1, False) == 0.0 |
15 | 17 |
|
16 | 18 |
|
17 | 19 | def test_omega_linear(): |
18 | | - oe = OrientationalEntropy(None, None, None, None, None) |
| 20 | + oe = OrientationalEntropy(_GAS_CONST) |
19 | 21 | omega = oe._omega(6, 2, True) |
20 | 22 | assert omega == 3.0 |
21 | 23 |
|
22 | 24 |
|
| 25 | +def test_omega_nonlinear(): |
| 26 | + oe = OrientationalEntropy(_GAS_CONST) |
| 27 | + omega = oe._omega(6, 2, False) |
| 28 | + assert omega == pytest.approx(13.02482) |
| 29 | + |
| 30 | + |
23 | 31 | def test_omega_no_symmetry(): |
24 | | - oe = OrientationalEntropy(None, None, None, None, None) |
| 32 | + oe = OrientationalEntropy(_GAS_CONST) |
25 | 33 | omega = oe._omega(6, 0, False) |
26 | 34 | assert omega == 1.0 |
0 commit comments