From ef978ead6f3033e9b731eaf916c1cfedcd030b61 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Mon, 20 Mar 2023 20:26:31 +0000 Subject: [PATCH] Avoid duplicate records for minimisation protocol. --- python/BioSimSpace/Process/_amber.py | 7 +++++++ python/BioSimSpace/Sandpit/Exscientia/Process/_amber.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/python/BioSimSpace/Process/_amber.py b/python/BioSimSpace/Process/_amber.py index 27c3a49b7..0afd7addf 100644 --- a/python/BioSimSpace/Process/_amber.py +++ b/python/BioSimSpace/Process/_amber.py @@ -1521,6 +1521,13 @@ def stdout(self, n=10): # Split the line using whitespace. data = line.upper().split() + # The file hasn't been updated. + if ( + "NSTEP" in self._stdout_dict + and data[0] == self._stdout_dict["NSTEP"][-1] + ): + return + # Add the timestep and energy records to the dictionary. self._stdout_dict["NSTEP"] = data[0] self._stdout_dict["ENERGY"] = data[1] diff --git a/python/BioSimSpace/Sandpit/Exscientia/Process/_amber.py b/python/BioSimSpace/Sandpit/Exscientia/Process/_amber.py index 75d659781..24bc9c261 100644 --- a/python/BioSimSpace/Sandpit/Exscientia/Process/_amber.py +++ b/python/BioSimSpace/Sandpit/Exscientia/Process/_amber.py @@ -1720,6 +1720,13 @@ def stdout(self, n=10): # Split the line using whitespace. data = line.upper().split() + # The file hasn't been updated. + if ( + "NSTEP" in self._stdout_dict + and data[0] == self._stdout_dict["NSTEP"][-1] + ): + return + # Add the timestep and energy records to the dictionary. self._stdout_dict["NSTEP"] = data[0] self._stdout_dict["ENERGY"] = data[1]