From accc097e8aba2d49d7bccc284ddc7e4bcce7c18e Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Fri, 27 Oct 2023 15:50:44 +0100 Subject: [PATCH] Remove end-state velocity property from perturbable molecules. --- .../Sandpit/Exscientia/_SireWrappers/_system.py | 12 ++++++++++++ python/BioSimSpace/_SireWrappers/_system.py | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_system.py b/python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_system.py index d6c56ec78..30f7915e1 100644 --- a/python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_system.py +++ b/python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_system.py @@ -664,6 +664,18 @@ def addMolecules(self, molecules): _warnings.warn( "Failed to remove 'velocity' property from all molecules!" ) + if num_pert_vels > 0: + try: + self._sire_object = _SireIO.removeProperty( + self._sire_object, "velocity0" + ) + self._sire_object = _SireIO.removeProperty( + self._sire_object, "velocity1" + ) + except: + _warnings.warn( + "Failed to remove 'velocity0' and 'velocity1' property from molecules!" + ) def removeMolecules(self, molecules): """ diff --git a/python/BioSimSpace/_SireWrappers/_system.py b/python/BioSimSpace/_SireWrappers/_system.py index e76360f4b..1820bcd76 100644 --- a/python/BioSimSpace/_SireWrappers/_system.py +++ b/python/BioSimSpace/_SireWrappers/_system.py @@ -664,6 +664,18 @@ def addMolecules(self, molecules): _warnings.warn( "Failed to remove 'velocity' property from all molecules!" ) + if num_pert_vels > 0: + try: + self._sire_object = _SireIO.removeProperty( + self._sire_object, "velocity0" + ) + self._sire_object = _SireIO.removeProperty( + self._sire_object, "velocity1" + ) + except: + _warnings.warn( + "Failed to remove 'velocity0' and 'velocity1' property from molecules!" + ) def removeMolecules(self, molecules): """