Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

BUG: Fix only settings not being properly updated for PES-averaged ARMC #273

Merged
merged 1 commit into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions FOX/armc/armc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion FOX/armc/armc_pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down