Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix_354' into feature_AToM
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Oct 24, 2024
2 parents 24f8825 + 0b9b29f commit f5b9429
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
17 changes: 13 additions & 4 deletions python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,8 +1238,9 @@ def rotateBoxVectors(

from sire.system import System

# Create a cursor.
cursor = System(self._sire_object).cursor()
# Create a cursor for the non-perturbable molecules.
system = System(self._sire_object)
cursor = system["not property is_perturbable"].cursor()

# Rotate all vector properties.

Expand Down Expand Up @@ -1267,8 +1268,15 @@ def rotateBoxVectors(
except:
pass

# Update the molecules in the system.
system.update(cursor.commit())
self._sire_object = system._system

# Now deal with any perturbable molecules.
if self.nPerturbableMolecules() > 0:
# Create a cursor for the perturbable molecules.
cursor = system["property is_perturbable"].cursor()

# Coordinates.
try:
prop_name = property_map.get("coordinates", "coordinates") + "0"
Expand Down Expand Up @@ -1307,8 +1315,9 @@ def rotateBoxVectors(
except:
pass

# Commit the changes.
self._sire_object = cursor.commit()._system
# Update the perturbable molecules in the system.
system.update(cursor.commit())
self._sire_object = system._system

def reduceBoxVectors(self, bias=0, property_map={}):
"""
Expand Down
17 changes: 13 additions & 4 deletions python/BioSimSpace/_SireWrappers/_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,9 @@ def rotateBoxVectors(

from sire.system import System

# Create a cursor.
cursor = System(self._sire_object).cursor()
# Create a cursor for the non-perturbable molecules.
system = System(self._sire_object)
cursor = system["not property is_perturbable"].cursor()

# Rotate all vector properties.

Expand Down Expand Up @@ -1215,8 +1216,15 @@ def rotateBoxVectors(
except:
pass

# Update the molecules in the system.
system.update(cursor.commit())
self._sire_object = system._system

# Now deal with any perturbable molecules.
if self.nPerturbableMolecules() > 0:
# Create a cursor for the perturbable molecules.
cursor = system["property is_perturbable"].cursor()

# Coordinates.
try:
prop_name = property_map.get("coordinates", "coordinates") + "0"
Expand Down Expand Up @@ -1255,8 +1263,9 @@ def rotateBoxVectors(
except:
pass

# Commit the changes.
self._sire_object = cursor.commit()._system
# Update the perturbable molecules in the system.
system.update(cursor.commit())
self._sire_object = system._system

def reduceBoxVectors(self, bias=0, property_map={}):
"""
Expand Down

0 comments on commit f5b9429

Please sign in to comment.