From 83f15a39e4eedd560dd3cf743e99c849e929622a Mon Sep 17 00:00:00 2001 From: Bas van Beek Date: Mon, 21 Mar 2022 17:29:25 +0100 Subject: [PATCH] BUG: Fix only settings not being properly updated for PES-averaged ARMC --- FOX/armc/armc.py | 8 ++++---- FOX/armc/armc_pt.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FOX/armc/armc.py b/FOX/armc/armc.py index bb2350c3..c9745fd7 100644 --- a/FOX/armc/armc.py +++ b/FOX/armc/armc.py @@ -257,7 +257,7 @@ def do_inner(self, kappa: int, omega: int, acceptance: np.ndarray, key_old: Key) """ # Step 1: Perform a random move - _key_new = self._do_inner1(key_old) + _key_new = self._do_inner1(key_old, idx=None) # Step 2: Calculate PES descriptors pes_new, pes_validation, mol_list = self._do_inner2() @@ -276,17 +276,17 @@ def do_inner(self, kappa: int, omega: int, acceptance: np.ndarray, key_old: Key) pes_new, pes_validation, kappa, omega) return key_new - def _do_inner1(self, key_old: Key, idx: int = 0) -> Key: + def _do_inner1(self, key_old: Key, idx: None | int) -> Key: """Perform a random move.""" key_new = self.move(idx=idx) if isinstance(key_new, Exception): self.logger.warning(f"Recalculating move; {key_new}") - return self._do_inner1(key_old) + return self._do_inner1(key_old, idx=idx) elif key_new in self: self.logger.info("Recalculating move; move has already been visited") - return self._do_inner1(key_old) + return self._do_inner1(key_old, idx=idx) return key_new diff --git a/FOX/armc/armc_pt.py b/FOX/armc/armc_pt.py index b426321b..2522c47b 100644 --- a/FOX/armc/armc_pt.py +++ b/FOX/armc/armc_pt.py @@ -192,7 +192,7 @@ def do_inner(self, kappa: int, omega: int, acceptance: np.ndarray, """ # Step 1: Perform a random move - _key_new = [self._do_inner1(key, i) for i, key in enumerate(key_old)] + _key_new = [self._do_inner1(key, idx=i) for i, key in enumerate(key_old)] # Step 2: Calculate PES descriptors pes_new, pes_validation, mol_list = self._do_inner2()