Skip to content

Commit

Permalink
Fixed PBC fixing when unsquashing for dummy atoms (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiki-tempula committed Sep 18, 2023
1 parent f9bed33 commit f1f5276
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/BioSimSpace/Sandpit/Exscientia/Align/_squash.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ def _unsquash_molecule(molecule, squashed_molecules, explicit_dummies=False):

# Apply the translation if the atom is coming from the second molecule.
if len(squashed_molecules) == 2 and apply_translation_vec:
# This is a dummy atom so we need to translate coordinates0 as well
if squashed_atom_idx0 == squashed_atom_idx1:
coordinates0 -= translation_vec
coordinates1 -= translation_vec

siremol = merged_atom.setProperty("coordinates0", coordinates0).molecule()
Expand Down
5 changes: 5 additions & 0 deletions tests/Sandpit/Exscientia/_SireWrappers/test_system.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import math
import pytest
import platform

import BioSimSpace.Sandpit.Exscientia as BSS

Expand Down Expand Up @@ -262,6 +263,10 @@ def test_get_box(system):
assert math.isclose(a0.value(), a1.value(), rel_tol=1e-4)


@pytest.mark.skipif(
platform != "Linux",
reason="Temporarily skipping test for macOS because the fixed sire 2023.2.3 has not been built for it",
)
def test_set_box(system):
# Generate box dimensions and angles for a truncated octahedron.
box, angles = BSS.Box.truncatedOctahedron(30 * BSS.Units.Length.angstrom)
Expand Down

0 comments on commit f1f5276

Please sign in to comment.