Skip to content

Commit

Permalink
Only copy aux file to workdir if PLUMED version < 2.7. [ref #194]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Mar 23, 2021
1 parent 13ee1dd commit e510c89
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions python/BioSimSpace/Process/_plumed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit e510c89

Please sign in to comment.