From 7b3ca36061ac32b431e5dcae40b8d6ea62825f9b Mon Sep 17 00:00:00 2001 From: Daniel Bauer Date: Wed, 27 Jun 2018 11:18:17 +0200 Subject: [PATCH] fix wham2d restart using data out of wham-2d bonds --- adaptiveumbrella/wham2d.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/adaptiveumbrella/wham2d.py b/adaptiveumbrella/wham2d.py index ed4b166..8b05c4f 100644 --- a/adaptiveumbrella/wham2d.py +++ b/adaptiveumbrella/wham2d.py @@ -38,10 +38,12 @@ class WHAM2DRunner(UmbrellaRunner): print("Not found: {}".format(filepath)) continue prefix, x, y = file.split("_") - colvar_file = os.path.join(file, 'COLVAR') - out.write("{file}\t{x}\t{y}\t{fc_x}\t{fc_y}\n".format( - file=os.path.join(self.simulation_folder, colvar_file), x=x, y=y, fc_x=self.whamconfig['fc_x'], fc_y=self.whamconfig['fc_y'] - )) + index = self._get_index_for_lambdas((float(x),float(y))) + if self.sample_list[index] != 0: + colvar_file = os.path.join(file, 'COLVAR') + out.write("{file}\t{x}\t{y}\t{fc_x}\t{fc_y}\n".format( + file=os.path.join(self.simulation_folder, colvar_file), x=x, y=y, fc_x=self.whamconfig['fc_x'], fc_y=self.whamconfig['fc_y'] + )) return path