Skip to content

Commit e47563a

Browse files
authored
Merge pull request #328 from CCPBioSim/327-ua-transvibrational-entropy
Fixing skipped transvibrational entropy.
2 parents f477bcb + 56538e4 commit e47563a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

CodeEntropy/entropy/nodes/vibrational.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def _compute_force_torque_entropy(
323323
EntropyPair containing translational entropy (from force covariance) and
324324
rotational entropy (from torque covariance).
325325
"""
326-
if fmat is None or tmat is None:
326+
if fmat is None and tmat is None:
327327
return EntropyPair(trans=0.0, rot=0.0)
328328

329329
f = self._mat_ops.filter_zero_rows_columns(
@@ -333,7 +333,7 @@ def _compute_force_torque_entropy(
333333
np.asarray(tmat), atol=self._zero_atol
334334
)
335335

336-
if f.size == 0 or t.size == 0:
336+
if f.size == 0 and t.size == 0:
337337
return EntropyPair(trans=0.0, rot=0.0)
338338

339339
s_trans = ve.vibrational_entropy_calculation(

tests/unit/CodeEntropy/entropy/nodes/test_vibrational_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def test_compute_force_torque_entropy_returns_zero_when_missing_matrix(shared_gr
321321
node = VibrationalEntropyNode()
322322
ve = MagicMock()
323323
pair = node._compute_force_torque_entropy(
324-
ve=ve, temp=298.0, fmat=None, tmat=np.eye(3), flexible=0, highest=True
324+
ve=ve, temp=298.0, fmat=None, tmat=None, flexible=0, highest=True
325325
)
326326
assert pair == EntropyPair(trans=0.0, rot=0.0)
327327

0 commit comments

Comments
 (0)