Skip to content

Commit 0793d84

Browse files
committed
Backport fix from PR #477. [ci skip]
1 parent da24c0a commit 0793d84

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_molecule.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,16 @@ def translate(self, vector, property_map={}):
14631463
_property_map["coordinates"] = "coordinates1"
14641464
mol = mol.move().translate(_SireMaths.Vector(vec), _property_map).commit()
14651465

1466+
# A user might have a custom coordinates property, so we need to check
1467+
# for this and translate too.
1468+
coord_prop = property_map.get("coordinates", "coordinates")
1469+
if self._sire_object.has_property(coord_prop):
1470+
mol = (
1471+
self._sire_object.move()
1472+
.translate(_SireMaths.Vector(vec), _property_map)
1473+
.commit()
1474+
)
1475+
14661476
else:
14671477
mol = (
14681478
self._sire_object.move()

python/BioSimSpace/_SireWrappers/_molecule.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,16 @@ def translate(self, vector, property_map={}):
14031403
_property_map["coordinates"] = "coordinates1"
14041404
mol = mol.move().translate(_SireMaths.Vector(vec), _property_map).commit()
14051405

1406+
# A user might have a custom coordinates property, so we need to check
1407+
# for this and translate too.
1408+
coord_prop = property_map.get("coordinates", "coordinates")
1409+
if self._sire_object.has_property(coord_prop):
1410+
mol = (
1411+
self._sire_object.move()
1412+
.translate(_SireMaths.Vector(vec), _property_map)
1413+
.commit()
1414+
)
1415+
14061416
else:
14071417
mol = (
14081418
self._sire_object.move()

0 commit comments

Comments
 (0)