From e510c89abc7b665ced647ec508c5085ee59b3c73 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Tue, 23 Mar 2021 10:01:45 +0000 Subject: [PATCH] Only copy aux file to workdir if PLUMED version < 2.7. [ref #194] --- python/BioSimSpace/Process/_plumed.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/python/BioSimSpace/Process/_plumed.py b/python/BioSimSpace/Process/_plumed.py index 36543238d..3d4725aae 100644 --- a/python/BioSimSpace/Process/_plumed.py +++ b/python/BioSimSpace/Process/_plumed.py @@ -78,9 +78,9 @@ def __init__(self, work_dir): # Run a PLUMED as a background process to query the version number. process = _subprocess.run("%s info --version" % self._exe, shell=True, stdout=_subprocess.PIPE) - plumed_version = float(process.stdout.decode("ascii").strip()) + self._plumed_version = float(process.stdout.decode("ascii").strip()) - if plumed_version < 2.5: + if self._plumed_version < 2.5: raise _Exceptions.IncompatibleError("PLUMED version >= 2.5 is required.") # Set the working directory of the process. @@ -265,11 +265,13 @@ def createConfig(self, system, protocol, is_restart=False): # Store the indices of the largest and second largest molecules. molecules = [sorted_nums[-1][1], sorted_nums[-2][1]] - # The funnel collective variable requires an auxillary file. - aux_file = "ProjectionOnAxis.cpp" - self._config.append(f"LOAD FILE={aux_file}") - aux_file = _os.path.dirname(_CollectiveVariable.__file__) + "/" + aux_file - self._aux_files.append(aux_file) + # The funnel collective variable requires an auxillary file for + # PLUMED versions < 2.7. + if self._plumed_version < 2.7: + aux_file = "ProjectionOnAxis.cpp" + self._config.append(f"LOAD FILE={aux_file}") + aux_file = _os.path.dirname(_CollectiveVariable.__file__) + "/" + aux_file + self._aux_files.append(aux_file) # Initialise the configuration string. string = "WHOLEMOLECULES"