Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CodeEntropy/entropy/nodes/vibrational.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def _compute_force_torque_entropy(
EntropyPair containing translational entropy (from force covariance) and
rotational entropy (from torque covariance).
"""
if fmat is None or tmat is None:
if fmat is None and tmat is None:
return EntropyPair(trans=0.0, rot=0.0)

f = self._mat_ops.filter_zero_rows_columns(
Expand All @@ -333,7 +333,7 @@ def _compute_force_torque_entropy(
np.asarray(tmat), atol=self._zero_atol
)

if f.size == 0 or t.size == 0:
if f.size == 0 and t.size == 0:
return EntropyPair(trans=0.0, rot=0.0)

s_trans = ve.vibrational_entropy_calculation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def test_compute_force_torque_entropy_returns_zero_when_missing_matrix(shared_gr
node = VibrationalEntropyNode()
ve = MagicMock()
pair = node._compute_force_torque_entropy(
ve=ve, temp=298.0, fmat=None, tmat=np.eye(3), flexible=0, highest=True
ve=ve, temp=298.0, fmat=None, tmat=None, flexible=0, highest=True
)
assert pair == EntropyPair(trans=0.0, rot=0.0)

Expand Down
Loading