From e95f8212d68525c8fa6cbe061776a3032f328677 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Mon, 27 Nov 2023 11:55:32 +0000 Subject: [PATCH] Allow hyphens in perturbable_constraint option. [closes #130] --- doc/source/changelog.rst | 3 +++ wrapper/Convert/SireOpenMM/openmmmolecule.cpp | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 413ca404e..a3a3d5bd7 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -48,6 +48,9 @@ organisation on `GitHub `__. to keep existing behaviour, but we would recommend setting this to ``True`` and would like to change the default in the future. +* Fix validation of ``perturbable_constraint`` dynamics option when the string + includes hyphens. This fixes issue #130. + * Please add an item to this changelog when you create your PR `2023.4.1 `__ - October 2023 diff --git a/wrapper/Convert/SireOpenMM/openmmmolecule.cpp b/wrapper/Convert/SireOpenMM/openmmmolecule.cpp index 07083cc04..048a62c5d 100644 --- a/wrapper/Convert/SireOpenMM/openmmmolecule.cpp +++ b/wrapper/Convert/SireOpenMM/openmmmolecule.cpp @@ -130,7 +130,7 @@ OpenMMMolecule::OpenMMMolecule(const Molecule &mol, { perturbable_constraint_type = CONSTRAIN_NONE; } - else if (c == "h-bonds") + else if (c == "h-bonds" or c == "h_bonds") { perturbable_constraint_type = CONSTRAIN_HBONDS; } @@ -138,11 +138,11 @@ OpenMMMolecule::OpenMMMolecule(const Molecule &mol, { perturbable_constraint_type = CONSTRAIN_BONDS; } - else if (c == "h-bonds-h-angles") + else if (c == "h-bonds-h-angles" or c == "h_bonds_h_angles") { perturbable_constraint_type = CONSTRAIN_HBONDS | CONSTRAIN_HANGLES; } - else if (c == "bonds-h-angles") + else if (c == "bonds-h-angles" or c == "bonds_h_angles") { perturbable_constraint_type = CONSTRAIN_BONDS | CONSTRAIN_HANGLES; }